A. New Year and Hurry
time limit per test 1 second memory limit per test 256 megabytes
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?

传送门:CF750A

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.

Sample Input

1
3 222

Sample Output

1
2

题解

简单循环
## AC code:(不包含输入类)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.io.*;  
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int k=sc.nextInt();
int time=240-k;
int index=-1;
int cs=0;
while(time>0){
time=time-cs*5;
if(time>=0) cs++;
}
if(cs-1>=n)
System.out.println(n);
else
System.out.println(cs-1);
}
}