{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"hlce","formal_name":"Humanity's Last Code Exam","introduction":"ICPC World FinalsとIOIの競技プログラミング問題を使い、問題解決とコード生成の能力を評価します。公式紹介では235問を収録し、今回の取得は公開ICPCデータ146問を対象とします。\n\nHumanity's Last Code Exam evaluates problem solving and code generation using ICPC World Finals and IOI problems. The project describes 235 problems; this import selects its public ICPC dataset of 146 problems.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://humanity-s-last-code-exam.github.io/website/","indexing_mode":"noindex"},"task_id":"32e142b0-cad0-5ffa-ace0-1e23fc1c7467","task_key":"ICPC~2dWorld~2dFinals--examples--2011~5fF","task_revision_id":"1","upstream_id":"2011_F","short_description":"Machine Works","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"## Problem Description\\n\\nYou are the director of Arbitrarily Complex Machines (ACM for short), a company producing advanced machinery using even more advanced machinery. The old production machinery has broken down, so you need to buy new production machines for the company. Your goal is to make as much money as possible during the restructuring period. During this period you will be able to buy and sell machines and operate them for profit while ACM owns them. Due to space restrictions, ACM can own at most one machine at a time.\\n\\nDuring the restructuring period, there will be several machines for sale. Being an expert in the advanced machines market, you already know the price \\\\( P_i \\\\) and the availability day \\\\( D_i \\\\) for each machine \\\\( M_i \\\\). Note that if you do not buy machine \\\\( M_i \\\\) on day \\\\( D_i \\\\), then somebody else will buy it and it will not be available later. Needless to say, you cannot buy a machine if ACM has less money than the price of the machine.\\n\\nIf you buy a machine \\\\( M_i \\\\) on day \\\\( D_i \\\\), then ACM can operate it starting on day \\\\( D_i + 1 \\\\). Each day that the machine operates, it produces a profit of \\\\( G_i \\\\) dollars for the company.\\n\\nYou may decide to sell a machine to reclaim a part of its purchase price any day after you’ve bought it. Each machine has a resale price \\\\( R_i \\\\) for which it may be resold to the market. You cannot operate a machine on the day that you sell it, but you may sell a machine and use the proceeds to buy a new machine on the same day.\\n\\nOnce the restructuring period ends, ACM will sell any machine that it still owns. Your task is to maximize the amount of money that ACM makes during the restructuring.\\n\\n## Input\\n\\nThe input consists of several test cases. Each test case starts with a line containing three positive integers \\\\( N \\\\), \\\\( C \\\\), and \\\\( D \\\\). \\\\( N \\\\) is the number of machines for sale (\\\\( N \\\\leq 10^5 \\\\)), \\\\( C \\\\) is the number of dollars with which the company begins the restructuring (\\\\( C \\\\leq 10^9 \\\\)), and \\\\( D \\\\) is the number of days that the restructuring lasts (\\\\( D \\\\leq 10^9 \\\\)).\\n\\nEach of the next \\\\( N \\\\) lines describes a single machine for sale. Each line contains four integers \\\\( D_i \\\\), \\\\( P_i \\\\), \\\\( R_i \\\\), and \\\\( G_i \\\\), denoting (respectively) the day on which the machine is for sale, the dollar price for which it may be bought, the dollar price for which it may be resold, and the daily profit generated by operating the machine. These numbers satisfy \\\\( 1 \\\\leq D_i \\\\leq D \\\\), \\\\( 1 \\\\leq R_i < P_i \\\\leq 10^9 \\\\), and \\\\( 1 \\\\leq G_i \\\\leq 10^9 \\\\).\\n\\nThe last test case is followed by a line containing three zeros.\\n\\n## Output\\n\\nFor each test case, display its case number followed by the largest number of dollars that ACM can have at the end of day \\\\( D + 1 \\\\).\\n\\nFollow the format of the sample output.\\n\\n## Sample Input\\n\\n```\\n6 10 20\\n6 12 1 3\\n1 9 1 2\\n3 2 1 2\\n8 20 5 4\\n4 11 7 4\\n2 10 9 1\\n0 0 0\\n```\\n\\n## Output for the Sample Input\\n\\n```\\nCase 1: 44\\n```\",\"question_title\":\"Machine Works\"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://humanity-s-last-code-exam.github.io/website/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}