4436: 新年快点

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:6 通过:4

题目描述

        Limak将在2016年的最后一天参加一场比赛。比赛将于20:00开始,持续四个小时,直到午夜。将有N个问题,按难度排序,即问题1是最容易的,问题N是最难的。利马克知道他需要5*i分钟才能解决第i个问题。

        利马克的朋友们组织了一个新年晚会,利马克想在午夜或更早的时候去那里。他需要K分钟才能从他的房子到达那里,在那里他将首先参加比赛。

        如果利马克想参加聚会,他能解决多少问题?

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 n problems, sorted by difficulty, i.e. problem 1 is the easiest and problem n is the hardest. Limak knows it will take him i minutes to solve the i-th problem.
Limak's friends organize a New Year's Eve party and Limak wants to be there at midnight or earlier. He needs k 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?
Input
The only line of the input contains two integers n and k (1≤n≤10, 1≤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.
Output
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.
Examples
Input
3 222
Output
2
Input
4 190
Output
4
Input
7 1
Output
7
Note
In the first sample, there are 3 problems and Limak needs 222 minutes to get to the party. The three problems require 5, 10 and 15 minutes respectively. Limak can spend 5+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 222 minutes). In this scenario Limak would solve 2 problems. He doesn't have enough time to solve 3 problems so the answer is 2.
In the second sample, Limak can solve all 4 problems in 5+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 1 minute to get to the party. He has enough time to solve all 7 problems.

输入格式

输入的唯一一行包含两个整数n和k(1≤n≤10,1≤k≤240)-竞赛中的问题数量和Limak从家里到聚会所需的分钟数。

输出格式

输出一个整数,表示Limak可以解决的问题的最大可能数量,以便他可以在午夜或更早到达聚会。
样例输入
3 222
样例输出
2
样例输入
4 190
样例输出
4
样例输入
7 1
样例输出
7

输入样例 复制

3 222

输出样例 复制

2

数据范围与提示

        在第一个样例中,有三个问题,Limak需要222纷争到达派对。做出三个问题分别需要5,10和15分钟。Limak可以花5+10=15分钟去解决前两个问题。然后他在20:15离开他的房子并(在222分钟后)在23:57到达派对。在这个方案中Limak可以解决2个问题。他没有足够的时间解决三个问题所以答案是2.
        在第二个样例中,Limak能用5+10+15+20=50分钟解决全部4个问题。他在20:50出发前往派对。他将正好在午夜到达。
        在第三个样例中,Limak只需要1分钟前往派对。他有足够的时间解决全部7个问题。