#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, k, i, sum;
while(~scanf("%d%d",&n, &k))
{
sum = k;
for(i = 0; i <= n; i ++)
{
sum += i * 5;
if(sum > 240)
break;
}
printf("%d\n", i - 1);
}
return 0;
}

看懂题意就能做出来了。

题目描述:

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

Example

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 spend5 + 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 solve2 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.

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

  1. 【codeforces 750A】New Year and Hurry

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

  2. 750A New Year and Hurry

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

  3. Codeforces Round #200 (Div. 1) B. Alternating Current 栈

    B. Alternating Current Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/343 ...

  4. Codeforces Good Bye 2016 题解

    好久没有fst题了...比赛先A了前4题然后发现room里有人已经X完题了没办法只能去打E题,结果差一点点打完...然后C题fst掉了结果就掉rating 了...下面放题解 ### [A. New ...

  5. Codeforces Beta Round #9 (Div. 2 Only) A. Die Roll 水题

    A. Die Roll 题目连接: http://www.codeforces.com/contest/9/problem/A Description Yakko, Wakko and Dot, wo ...

  6. CodeForces - 344D Alternating Current (模拟题)

    id=46667" style="color:blue; text-decoration:none">CodeForces - 344D id=46667" ...

  7. Codeforces Round #200 (Div. 2)D. Alternating Current (堆栈)

    D. Alternating Current time limit per test 1 second memory limit per test 256 megabytes input standa ...

  8. 【25.64%】【codeforces 570E】Pig and Palindromes

    time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  9. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

随机推荐

  1. Educational Codeforces Round 61 (Div.2)

    A.(c1=0&&c3>0)||(c1!=c4) #include<cstdio> #include<cstring> #include<algor ...

  2. 服务篇:我的第一WebService应用

    一.我的第一个Webservice应用 1.新建一个空项目 2.添加新项,加入asmx,并再浏览器浏览 3.添加一个aspx网页 4.右键引用→添加服务引用→高级→添加Web引用,输入再浏览器浏览的a ...

  3. 如何使用Cloud Foundry CLI把一个应用推送到MindSphere

    一.登录MindSphere - Cloud Foundry 1. 安装Cloud Foundry CLI (Command Line Interface). 下载地址:https://github. ...

  4. C#操作Windows控制面板

    先介绍一下Windows控制面板的一些操作,再介绍如何用C#语言来操作控制面板. 1.如何快速打开控制面板中的项目: 运行输入(大小写不敏感) control system 打开系统信息 contro ...

  5. C#笔试题目总结

    基础 知识点 try catch finally的执行顺序(有return的情况下): 不管有没有出现异常,finally块中代码都会执行: 当try和catch中有return时,finally仍然 ...

  6. spark-submit之使用pyspark

    在linux下,执行pyspark代码 —— 实测有效:但是并不是所有的包都能够成功,一些很复杂的包或者对C依赖很深的包例如 numpy, pandas, scipy等,无法通过本方法实现:对一些比较 ...

  7. Java中实现图片的上传

    这边直接存放在c盘的指定目录,在property中指定了一个目录 没有花时间写用户操作的上传页面,直接用swagger2插件,可以上传 默认图片大小超过1mb就不可以上传,可以如下更改 server. ...

  8. Nginx access_log日志添加返回字段

    主要为方便单用户请求日志回溯分析   记录用户标记. 将用户信息打印在access_log 日志里. 步骤: 1.重写nginx 的log格式 一般是地址是  /etc/nginx/conf.d/ng ...

  9. 【转】通过BeanNameAutoProxyCreator改变臃肿代码

    https://www.cnblogs.com/zdd-java/p/7861824.html 前言: 最近接手了一个项目,大概过了下需求,然后打开项目准备开搞的时候发现一个问题,这个项目是提供res ...

  10. Stages — 研发过程可视化建模和管理平台

    Stages 是德国Method park公司的产品,用于帮助企业定义.管理.发布.控制.优化其研发过程,同时使其研发过程符合CMMI.ASPICE.ISO26262等标准.Stages的核心理念是把 ...