{"problem":{"name":"F. Hitting the target","description":{"content":"Sitting in front of the computer for too long is no good for your health. Keeping this in mind, the MaratonIME coaches decided to motivate the contestants to practice sports, not just programming. The","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10149F"},"statements":[{"statement_type":"Markdown","content":"Sitting in front of the computer for too long is no good for your health. Keeping this in mind, the MaratonIME coaches decided to motivate the contestants to practice sports, not just programming. They didn't want to stick with the basics, so they chose the bow and arrow.\n\nHowever, they noticed that too many people showed up at practice sessions just to shoot arrows. To discourage people with no interest in programming, they decided to add a requirement for shooting arrows: one would have to code a program that takes the coordinates of 3 arrows and record the final score. The target is made of ten concentric circles of proportional radii, that is, the smallest circle has radius R, the second one has radius 2R, the third one has radius 3R, and so on. The circle with smallest radius grants 10 points, and the largest one awards only 1 point. An arrow that hits the boundary between two circles grants the largest of the two scores.\n\nDon't miss your opportunity to participate at the programming contest: write this program.\n\nThe input has a line that has an integer R, the radius of the smallest circle. Next there are three lines with pairs of integers, x and y, the points in the target hit by each arrow. The target center is at coordinate (0, 0).\n\nThe output has a single integer: the final score.\n\n## Input\n\nThe input has a line that has an integer R, the radius of the smallest circle. Next there are three lines with pairs of integers, x and y, the points in the target hit by each arrow. The target center is at coordinate (0, 0).  1 ≤ R ≤ 102   - 103 ≤ x, y ≤ 103 \n\n## Output\n\nThe output has a single integer: the final score.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ n_k \\in \\mathbb{Z} $ be the number of ingredients needed.  \n- Let $ k_k \\in \\mathbb{Z} $ be the maximum number of ingredients allowed outside the refrigerator.  \n- Let $ A_k = (a_{k,1}, a_{k,2}, \\dots, a_{k,n_k}) $ be the sequence of ingredient IDs in usage order.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 100 $  \n2. For each $ k \\in \\{1, \\dots, T\\} $:  \n   - $ 1 \\le n_k, k_k \\le 10^5 $  \n   - $ 1 \\le a_{k,i} \\le 10^9 $ for all $ i \\in \\{1, \\dots, n_k\\} $  \n\n**Objective**  \nMinimize the number of refrigerator openings.  \nAn ingredient must be taken from the refrigerator if and only if it is not currently outside.  \nIf the set of outside ingredients has size $ k_k $ and a new ingredient is needed, one must be returned to the refrigerator before taking the new one.  \nThe choice of which ingredient to return is optimal to minimize future openings.  \n\nLet $ S \\subseteq \\mathbb{Z}^+ $ denote the set of ingredients currently outside the refrigerator.  \nInitialize $ S = \\emptyset $, and $ \\text{openings} = 0 $.  \nFor each $ i = 1 $ to $ n_k $:  \n- If $ a_{k,i} \\notin S $:  \n  - If $ |S| < k_k $: add $ a_{k,i} $ to $ S $, increment $ \\text{openings} $.  \n  - Else: remove one element from $ S $ (optimally chosen), add $ a_{k,i} $, increment $ \\text{openings} $.  \n\nCompute $ \\text{openings} $ for each test case.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10149F","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}