{"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":"0a95d014-c5f4-5619-88d2-b6f21c5e633b","task_key":"ICPC~2dWorld~2dFinals--examples--2020~5fG","task_revision_id":"1","upstream_id":"2020_G","short_description":"Opportunity Cost","config":"ICPC-World-Finals","split":"examples","body":"{\"platform\":\"atcoder\",\"question_content\":\"## Problem Description\\n\\nAs with most types of products, buying a new phone can be difficult. One of the main challenges is that there are a lot of different aspects of the phone that you might care about, such as its price, its performance, and how user-friendly the phone is. Typically, there will be no single phone that is simultaneously the best at all of these things: the cheapest phone, the most powerful phone, and the most user-friendly phone will likely be different phones.\\n\\nThus when buying a phone, you are forced to make some sacrifices by balancing the different aspects you care about against each other and choosing the phone that achieves the best compromise (where “best” of course depends on what your priorities happen to be). One way of measuring this sacrifice is known as the opportunity cost, which (for the purposes of this problem) we define as follows.\\n\\nSuppose that you have bought a phone with price \\\\(x\\\\), performance \\\\(y\\\\), and user-friendliness \\\\(z\\\\). For simplicity, we assume that these three values are measured on a comparable numeric scale where higher is better. If there are \\\\(n\\\\) available phones, and the values \\\\((x_i, y_i, z_i)\\\\) represent the (price, performance, user-friendliness) of the \\\\(i\\\\)-th phone, then the opportunity cost of your phone is defined as:\\n\\n\\\\[\\n\\\\max_{1 \\\\leq i \\\\leq n} (\\\\max(x_i - x, 0) + \\\\max(y_i - y, 0) + \\\\max(z_i - z, 0))\\n\\\\]\\n\\nWrite a program that, given the list of available phones, finds a phone with the minimum opportunity cost.\\n\\n## Input\\n\\n- The first line of input contains an integer \\\\(n\\\\) (\\\\(2 \\\\leq n \\\\leq 200,000\\\\)), the number of phones considered.\\n- Following that are \\\\(n\\\\) lines. The \\\\(i\\\\)-th of these lines contains three integers \\\\(x_i\\\\), \\\\(y_i\\\\), and \\\\(z_i\\\\), where \\\\(x_i\\\\) is the price, \\\\(y_i\\\\) is the performance, and \\\\(z_i\\\\) is the user-friendliness of the \\\\(i\\\\)-th phone (\\\\(1 \\\\leq x_i, y_i, z_i \\\\leq 10^9\\\\)).\\n\\n## Output\\n\\n- Output a single line containing two integers: the smallest possible opportunity cost and an integer between 1 and \\\\(n\\\\) indicating the phone achieving that opportunity cost. If there are multiple such phones, output the one with the smallest index.\\n\\n## Sample Input 1\\n\\n```\\n4\\n20 5 5\\n5 20 5\\n5 5 20\\n10 10 10\\n```\\n\\n## Sample Output 1\\n\\n```\\n10 4\\n```\\n\\n## Sample Input 2\\n\\n```\\n4\\n15 15 5\\n5 15 15\\n15 5 15\\n10 10 10\\n```\\n\\n## Sample Output 2\\n\\n```\\n10 1\\n```\",\"question_title\":\"Opportunity Cost\"}","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":[]}