CF750A.New Year and Hurry

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four hours, exactly until midnight. There will be nn problems, sorted by difficulty, i.e. problem 11 is the easiest and problem nn is the hardest. Limak knows it will take him 5i5·i minutes to solve the ii -th problem.

Limak's friends organize a New Year's Eve party and Limak wants to be there at midnight or earlier. He needs kk minutes to get there from his house, where he will participate in the contest first.

How many problems can Limak solve if he wants to make it to the party?

输入格式

The only line of the input contains two integers nn and kk ( 1<=n<=101<=n<=10 , 1<=k<=2401<=k<=240 ) — the number of the problems in the contest and the number of minutes Limak needs to get to the party from his house.

输出格式

Print one integer, denoting the maximum possible number of problems Limak can solve so that he could get to the party at midnight or earlier.

输入输出样例

  • 输入#1

    3 222
    

    输出#1

    2
    
  • 输入#2

    4 190
    

    输出#2

    4
    
  • 输入#3

    7 1
    

    输出#3

    7
    

说明/提示

In the first sample, there are 33 problems and Limak needs 222222 minutes to get to the party. The three problems require 55 , 1010 and 1515 minutes respectively. Limak can spend 5+10=155+10=15 minutes to solve first two problems. Then, at 20:15 he can leave his house to get to the party at 23:57 (after 222222 minutes). In this scenario Limak would solve 22 problems. He doesn't have enough time to solve 33 problems so the answer is 22 .

In the second sample, Limak can solve all 44 problems in 5+10+15+20=505+10+15+20=50 minutes. At 20:50 he will leave the house and go to the party. He will get there exactly at midnight.

In the third sample, Limak needs only 11 minute to get to the party. He has enough time to solve all 77 problems.

首页