A. New Year and Hurry
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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?

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.

 #include <iostream>

 using namespace std;

 int main()
{
int num, party;
cin >> num >> party;
const int time = ;
party = time - party;
int ans = , n = ;
while(party > && ans < num)
{
party -= *n;
if(party >= )
{
n++;
ans ++;
}
}
cout << ans << endl;
return ;
}

750A New Year and Hurry的更多相关文章

  1. CodeForces 750A New Year and Hurry

    #include<bits/stdc++.h> using namespace std; int main() { int n, k, i, sum; while(~scanf(" ...

  2. 【codeforces 750A】New Year and Hurry

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  3. CodeFroces--Good Bye 2016-A-New Year and Hurry(水题-模拟)

    A. New Year and Hurry time limit per test 1 second memory limit per test 256 megabytes input standar ...

  4. 新概念英语(1-43)Hurry up!

    新概念英语(1-43)Hurry up! How do you know Sam doesn't make the tea very often? A:Can you make the tea, Sa ...

  5. Good Bye 2016 A. New Year and Hurry【贪心/做题目每道题花费时间按步长为5等差增长,求剩余时间够做几道题】

    A. New Year and Hurry time limit per test 1 second memory limit per test 256 megabytes input standar ...

  6. 输入一个url之后到底发生了什么 - Hurry

    背景 最近学习到 nginx 方向代理发现,nginx 可以将你的请求以 http 块的 server 形式代理到请求的域名或者 ip 地址. 一个简单的 nigx 配置如下: 12345678 se ...

  7. vi/vim使用指北 ---- Moving Around in a Hurry

    上一篇文章中,简单列出了一些基本的Vim操作,也列出了很多的光标移动命令,本章主要是有哪些命令可以更快的移动光标. vim的编辑操作,用得最多就是移动光标,对于很少行的文件来说,基本的命令就够用了,但 ...

  8. POJ 3858 Hurry Plotter(DP)

    Description A plotter is a vector graphics printing device that connects to a computer to print grap ...

  9. Lesson 19 Sold out

    Text 'The play may begin at any moment,' I said. 'It may have begun already,' Susan answered. I hurr ...

随机推荐

  1. CNN入门笔记

    在之前的学习中,没有认真了解卷积神经网络,由于一些原因需要使用CNN来做图像分类,开始学习了卷积神经网络,参考了一些资料并做了这份记录 为什么要用卷积神经网络 在图像处理中,往往把图像表示为像素的向量 ...

  2. Windows系统下Eclipse上搭建Python开发环境

    参考网站:   https://blog.csdn.net/zhangphil/article/details/78962159 1.先安装JDK 和python,参考网站:https://www.c ...

  3. Windows 忘记密码

    能进入windows,以前保存的凭据,但是不知道啥. windows下进入cmd net user administrator abc123 这样可以重置密码

  4. android -chrome 调试

    在chrome上 输入 chrome://inspect/ 连接手机,配置 监听8000,和8080端口 cordova默认是8000端口 如果出现白屏:原因:google在首次加载时,要进行服务器连 ...

  5. 使用Eclipse对FFmpeg进行调试

    在研究代码的过程中,调试运行是一种非常有效的方法.我们常用的Visual Studio建立的工程可以很方便地对程序进行调试运行.但是对于FFMpeg这样的工程,想要进行单步调试就没这么容易了.如果一定 ...

  6. Producer-consumer problem in Python

    from: http://agiliq.com/blog/2013/10/producer-consumer-problem-in-python/ By : Akshar Raaj We will s ...

  7. jstl遍历list的jsp

    jstl,核心标签库,使用,<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%& ...

  8. DOM 练习

    练习一: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...

  9. HTML 练习 做简历表

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  10. 大型运输行业实战_day02_1_数据库设计与powerDesigner使用

    1.安装powerDesigner 1. 傻瓜式的安装 2.在安装的过程中选择地区后才可以点击同意和下一步 3.安装地址,建议直接把c改为d 4.其他选项直接下一步 2.使用powerDesigner ...