{"problem":{"name":"A. New Year and Hurry","description":{"content":"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 difficul","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF750A"},"statements":[{"statement_type":"Markdown","content":"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.\n\nLimak'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.\n\nHow many problems can Limak solve if he wants to make it to the party?\n\n## Input\n\nThe 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.\n\n## Output\n\nPrint one integer, denoting the maximum possible number of problems Limak can solve so that he could get to the party at midnight or earlier.\n\n[samples]\n\n## Note\n\nIn 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.\n\nIn 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.\n\nIn the third sample, Limak needs only 1 minute to get to the party. He has enough time to solve all 7 problems.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Limak 将参加 2016 年最后一天的一场竞赛。比赛将于 20:00 开始，持续四小时，恰好到午夜结束。共有 #cf_span[n] 道题目，按难度排序，即第 #cf_span[1] 题最简单，第 #cf_span[n] 题最难。Limak 知道他解决第 #cf_span[i] 题需要 #cf_span[5·i] 分钟。\n\nLimak 的朋友们正在举办跨年派对，Limak 希望能在午夜或之前到达。他从家出发前往派对需要 #cf_span[k] 分钟，而他将在家先参加竞赛。\n\n如果 Limak 希望赶到派对，他最多能解决多少道题？\n\n输入仅有一行，包含两个整数 #cf_span[n] 和 #cf_span[k]（#cf_span[1 ≤ n ≤ 10]，#cf_span[1 ≤ k ≤ 240]），分别表示竞赛中的题目数量和 Limak 从家到派对所需的时间（分钟）。\n\n请输出一个整数，表示 Limak 能解决的最大题目数量，使得他能在午夜或之前到达派对。\n\n在第一个样例中，共有 #cf_span[3] 道题，Limak 需要 #cf_span[222] 分钟到达派对。三道题分别需要 #cf_span[5]、#cf_span[10] 和 #cf_span[15] 分钟。Limak 可以花费 #cf_span[5 + 10 = 15] 分钟解决前两道题。然后在 20:15 离开家，经过 #cf_span[222] 分钟后于 23:57 到达派对。在这种情况下，Limak 解决了 #cf_span[2] 道题。他没有足够时间解决第 #cf_span[3] 道题，因此答案是 #cf_span[2]。\n\n在第二个样例中，Limak 可以在 #cf_span[5 + 10 + 15 + 20 = 50] 分钟内解决全部 #cf_span[4] 道题。他在 20:50 离开家前往派对，恰好在午夜到达。\n\n在第三个样例中，Limak 只需要 #cf_span[1] 分钟到达派对，他有足够时间解决全部 #cf_span[7] 道题。\n\n## Input\n\n输入仅有一行，包含两个整数 #cf_span[n] 和 #cf_span[k]（#cf_span[1 ≤ n ≤ 10]，#cf_span[1 ≤ k ≤ 240]），分别表示竞赛中的题目数量和 Limak 从家到派对所需的时间（分钟）。\n\n## Output\n\n请输出一个整数，表示 Limak 能解决的最大题目数量，使得他能在午夜或之前到达派对。\n\n[samples]\n\n## Note\n\n在第一个样例中，共有 #cf_span[3] 道题，Limak 需要 #cf_span[222] 分钟到达派对。三道题分别需要 #cf_span[5]、#cf_span[10] 和 #cf_span[15] 分钟。Limak 可以花费 #cf_span[5 + 10 = 15] 分钟解决前两道题。然后在 20:15 离开家，经过 #cf_span[222] 分钟后于 23:57 到达派对。在这种情况下，Limak 解决了 #cf_span[2] 道题。他没有足够时间解决第 #cf_span[3] 道题，因此答案是 #cf_span[2]。\n\n在第二个样例中，Limak 可以在 #cf_span[5 + 10 + 15 + 20 = 50] 分钟内解决全部 #cf_span[4] 道题。他在 20:50 离开家前往派对，恰好在午夜到达。\n\n在第三个样例中，Limak 只需要 #cf_span[1] 分钟到达派对，他有足够时间解决全部 #cf_span[7] 道题。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of problems.  \nLet $ k \\in \\mathbb{Z} $ be the travel time (in minutes) to the party.  \nLet $ t_i = 5i $ be the time (in minutes) required to solve problem $ i $, for $ i \\in \\{1, 2, \\dots, n\\} $.  \n\n**Constraints**  \n1. $ 1 \\leq n \\leq 10 $  \n2. $ 1 \\leq k \\leq 240 $  \n3. Total available time: $ 240 $ minutes (from 20:00 to midnight).  \n\n**Objective**  \nFind the maximum integer $ m \\in \\{0, 1, \\dots, n\\} $ such that:  \n$$\n\\sum_{i=1}^{m} 5i + k \\leq 240\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF750A","tags":["binary search","brute force","implementation","math"],"sample_group":[["3 222","2"],["4 190","4"],["7 1","7"]],"created_at":"2026-03-03 11:00:39"}}