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

  1. 3 222

Output

  1. 2

Input

  1. 4 190

Output

  1. 4

Input

  1. 7 1

Output

  1. 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 分钟

代码:

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int SUM=240;
  1. int main()
  2. {
  3. int n,k;
  4. int t;
  5. cin>>n>>k;
  6. t=SUM-k;
  7. int flag=0;
  8. int s=0;
  9. for(int i=0;i<=n;i++){
  10. s+=(i*5);
  11. if(s>t){
  12. break;
  13. }
  14. else{
  15. flag=i;
  16. }
  17. }
  18. cout<<flag<<endl;
  19. }

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. 谈谈ThreadStatic

    可能经常做多线程.线程池的童鞋早就知道这种问题,原谅我一直对线程研究不深. 这个东西好像出现有一段时间了,不过最近我才用到,做的API的服务,用来保存当前请求的上下文内容,原来用过Thread.Set ...

  2. 关于手动关闭BootStrap模态框

    在网上找手动关闭BootStrap模态框的解决方法,说是(需要引用bootstrap.js等): $("#myModal").modal('hide'); 但是我发现我的只能关闭 ...

  3. Mac下MySQL的安装与配置

    之前一直用的是阿里云的服务器,在服务器上装了一个MySQL,但是今天发现到期了,而且续费时发现之前的大学生优惠不能用了,可是明明到6月份,大学生才毕业啊,shit!!!所以没办法只能在自己电脑上装一个 ...

  4. 微信小程序支付步骤

    http://blog.csdn.net/wangsf789/article/details/53419781 最近开发微信小程序进入到支付阶段,一直以来从事App开发,所以支付流程还是熟记于心的.但 ...

  5. 计算机网络课程优秀备考PPT之第六章传输层(六)

    为了记录自己从2016.9~2017.1的<计算机网络>助教生涯,也为了及时梳理和整写笔记! 前期博客是, 计算机网络课程优秀备考PPT之第一章概述(一) 计算机网络课程优秀备考PPT之第 ...

  6. 【成长之路】【python】python基础2

    1.位运算 &(与) | (或) ~ (非) ^(异或) 2.三元运算 c = a+b if a>b else a-b if (a>b): a+b else: a-b 3.小知识( ...

  7. 免费数据库(SQLite、Berkeley DB、PostgreSQL、MySQL、Firebird、mSQL、MSDE、DB2 Express-C、Oracle XE)

    SQLite数据库是中小站点CMS的最佳选择 SQLite 是一个类似Access的轻量级数据库系统,但是更小.更快.容量更大,并发更高.为什么说 SQLite 最适合做 CMS (内容管理系统)呢? ...

  8. 《JS权威指南学习总结--第九章 类和模板》

    内容要点: 一. 1.第六章详细介绍了JS对象,每个JS对象都是一个属性集合,相互之间没有任何联系.在JS中也可以定义对象的类,让每个对象都共享某些属性,这种"共享"的特性是非常有 ...

  9. mysql 批量修改表前缀

    直接贴码: SELECT a.*, concat( 'alter table ', a.TABLE_NAME, ' rename ge_', SUBSTR( a.TABLE_NAME FROM INS ...

  10. arttemplate函数摘录

    对artTemplate函数摘录,希望可以用到自己平时的工作中去 var toString = function (value, type) { if (typeof value !== 'strin ...