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.

题目大意:

在240-k分钟内最多可做多少道题目?

每道题目花费的时间为 5*i 分钟

代码:

#include<bits/stdc++.h>
using namespace std;
const int SUM=240;
int main()
{
int n,k;
int t;
cin>>n>>k;
t=SUM-k;
int flag=0;
int s=0;
for(int i=0;i<=n;i++){
s+=(i*5);
if(s>t){
break;
}
else{
flag=i;
}
}
cout<<flag<<endl;
}

CodeFroces--Good Bye 2016-A-New Year and Hurry(水题-模拟)的更多相关文章

  1. CodeFroces--Good Bye 2016-B--New Year and North Pole(水题-模拟)

    B. New Year and North Pole time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  2. 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 ...

  3. Codeforces Good Bye 2015 A. New Year and Days 水题

    A. New Year and Days 题目连接: http://www.codeforces.com/contest/611/problem/A Description Today is Wedn ...

  4. codeforces Good bye 2016 E 线段树维护dp区间合并

    codeforces Good bye 2016 E 线段树维护dp区间合并 题目大意:给你一个字符串,范围为‘0’~'9',定义一个ugly的串,即串中的子串不能有2016,但是一定要有2017,问 ...

  5. Codeforces Good Bye 2016 E. New Year and Old Subsequence

    传送门 题意: 给出一个长度为\(n\)的串,现在有\(q\)个询问,每个询问是一个区间\([l,r]\),要回答在区间\([l,r]\)中,最少需要删多少个数,满足区间中包含\(2017\)的子序列 ...

  6. Good Bye 2016

    A - New Year and Hurry (water) #include <bits/stdc++.h> using namespace std; int main() { ]; ; ...

  7. Good Bye 2016 - D

    题目链接:http://codeforces.com/contest/750/problem/D 题意:新年烟花爆炸后会往两端45°差分裂.分裂完后变成2部分,之后这2部分继续按这种规则分裂.现在给你 ...

  8. Good Bye 2016 - C

    题目链接:http://codeforces.com/contest/750/problem/C 题意:在CF中,每个人都有个Rank值. 当Rank>=1900时,为DIV1.Rank< ...

  9. Good Bye 2016 - B

    题目链接:http://codeforces.com/contest/750/problem/B 题意:地球的子午线长度为40000,两极点的距离为20000.现在你从北极出发,按照题目输入方式来走. ...

随机推荐

  1. 9、JavaScript常用函数

    1.alert()函数 用于弹出消息对话框提示用户信息,消息对话框由系统提供,不同浏览器中字体样式可能不同,通常用于调试程序. 2.confirm()函数 弹出一个OK按钮和一个Cancel按钮的消息 ...

  2. C++知识体系

    基础知识 推荐书目 C++ <C++程序设计>(课程教材即可,简而薄) <STL源码剖析>(对C++进一步深化,也是必备知识) <C++对象模型>(经典中经典,重点 ...

  3. HDU 5130 Signal Interference(计算几何 + 模板)

    HDU 5130 Signal Interference(计算几何 + 模板) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5130 Descripti ...

  4. JQ基础语法

    empty HTML 代码: <p>Hello, <span>Person</span> <a href="#">and perso ...

  5. IIS优化服务器性能导致QuartZ任务未运行

    问题: IIS 为优化服务器性能,会自动对它认为休眠的应用程序进行资源回收,资源回收将会导致网站应用程序关闭. 解决方案: 1.  设置闲置超时为0,固定回收时间间隔为0,即IIS不主动回收闲置进程 ...

  6. 在Ubuntu下搭建FTP服务器的方法

    由于整个学校相当于一个大型局域网,相互之间传送数据非常快,比如要共享个电影,传点资料什么的. 所以我们可以选择搭建一个FTP服务器来共享文件. 那么问题来了,有的同学会问,我们既然在一个局域网内,直接 ...

  7. jquery 学习笔记 (2)--write less,do more

    $(window).load(function(){      })           window.onload=function(){ } toggle()方法 toggle()方法的语法结构: ...

  8. 常见编程语言对REPL支持情况小结[转]

    文章转载自http://www.nowamagic.net/librarys/veda/detail/2462 最近跟一个朋友聊起编程语言的一些特性,他有个言论让我略有所思:“不能REPL的都是渣”. ...

  9. php基础(七)文件

    PHP 文件处理 PHP 操作文件 当您操作文件时必须非常小心.如果您操作失误,可能会造成非常严重的破坏.常见的错误是: 编辑错误的文件 被垃圾数据填满硬盘 意外删除文件内容 PHP readfile ...

  10. Python学习笔记_Chapter 7web开发

    1.web应用元素 a.成员: web浏览器 web服务器 b.行为: web请求: 请求内容: 静态内容:如html文件,图像. 动态内容:需服务器运行一个程序进而做出响应. 网关接口&CG ...