CF750A.New Year and Hurry
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
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 n problems, sorted by difficulty, i.e. problem 1 is the easiest and problem n is the hardest. Limak knows it will take him 5·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?
Limak 将在 2016 年最后一天参加一场比赛。比赛将于 20:00 开始,持续四小时,恰好到午夜结束。比赛共有 n 道题目,按难度升序排列,即第 1 题最简单,第 n 题最难。Limak 知道解决第 i 题需要 5⋅i 分钟。
Limak 的朋友们组织了一场跨年夜派对,Limak 希望能在午夜或更早抵达派对现场。他从自己家中(即他先参加比赛的地方)出发前往派对地点需要 k 分钟。
如果 Limak 想准时参加派对,他最多能解决多少道题?
输入格式
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.
输入仅包含一行,有两个整数 n 和 k(1 ≤ n ≤ 10,1 ≤ k ≤ 240)——分别表示比赛中的题目数量,以及 Limak 从家到派对所需的时间(单位:分钟)。
输出格式
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.
输出一个整数,表示 Limak 在午夜或之前到达派对的前提下,最多能解决的问题数量。
输入输出样例
输入#1
3 222
输出#1
2
输入#2
4 190
输出#2
4
输入#3
7 1
输出#3
7
说明/提示
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.
在第一个样例中,共有 3 道题目,Limak 需要 222 分钟才能到达派对。这三道题分别需要 5、10 和 15 分钟。Limak 可以花费 5+10=15 分钟解决前两道题。然后,他可以在 20:15 离开家,并于 23:57(即出发后 222 分钟)抵达派对。在此情形下,Limak 将解决 2 道题。他没有足够的时间解决全部 3 道题,因此答案为 2。
在第二个样例中,Limak 可以在 5+10+15+20=50 分钟内解决全部 4 道题。他将在 20:50 离开家前往派对,并恰好于午夜(00:00)抵达。
在第三个样例中,Limak 前往派对仅需 1 分钟。他有充足的时间解决全部 7 道题。
输入解题思路,AI测评打分。不知道怎么写?