{"problem":{"name":"H. MaratonIME goes to the movies","description":{"content":"Believe it if you can, studies show that we in MaratonIME live not only out of competitive programming. In a saturday, after taking part in a virtual contest, our heroes decide to enjoy the afternoon","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":4000,"memory_limit":131072},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10098H"},"statements":[{"statement_type":"Markdown","content":"Believe it if you can, studies show that we in MaratonIME live not only out of competitive programming.\n\nIn a saturday, after taking part in a virtual contest, our heroes decide to enjoy the afternoon watching a movie session. But they didn't choose any movie, but an n-D movie, that is, a movie with n dimensions.\n\nDuring a chase scene, the main character jumps over a chain in the parking lot. Of course this was done in a very athletic way, and for some reason that drove Yan, one of the competitive programmers, mad.\n\n\"Hollywood makes everything seem easy, but jumping over a chain is really hard!\"\n\nThe rest of the crowd, after the movie, argued with Yan that the actor surely jumped over the chain, but Yan disagreed, saying that it was done by some camera trick or by special effects.\n\nTo prove his point, he bought another ticket for the movie and this time he took highly precise measuring instruments to the session. Yan's plan was to show that the distance from the actor's foot to the floor was smaller than the distance from the chain to the floor, and that would prove that the actor didn't actually jump over the chain.\n\nBut math in n dimensions is hard. Everyone knows that distance in the 2D plane between two points (x0, y0) and (x1, y1) is given by the formula \n\nMost people also know that distance between two points (x0, y0, z0) e (x1, y1, z1) in 3D space is given by the formula \n\nBoth formulas describe the euclidean distance, in the 2 and 3 dimensional case. Your task is, given three points in an n dimensional space, tell if the the closest ones are the foot and the floor or the chain and the flooor, according to euclidean distance.\n\nThe input begins with an integer n, followed by three lines, each with the representation of a point in an n-dimensional space.\n\nDimensions confuse us, humans, so you can assume that 1 ≤ n ≤ 105.\n\nThe second line represents the coordinates of the *floor*, and contains n integers a1, ..., an.\n\nThe third line represents the coordinates of the *foot of the main character*, and contains n integers b1, ..., bn.\n\nThe fourth line represents the coordinates of the *chain*, and contains n integers c1, ..., cn.\n\nThe movie theather is not arbitrarily large, so you can assume that the absolute value of these coordinates are not greater than 104.\n\nPrint who wins the argument, that is, print \"Yan\" if the distance between the floor and the foot is *not greater* than the distance between the floor and the chain, or \"MaratonIME\" otherwise.\n\n## Input\n\nThe input begins with an integer n, followed by three lines, each with the representation of a point in an n-dimensional space.Dimensions confuse us, humans, so you can assume that 1 ≤ n ≤ 105.The second line represents the coordinates of the *floor*, and contains n integers a1, ..., an.The third line represents the coordinates of the *foot of the main character*, and contains n integers b1, ..., bn.The fourth line represents the coordinates of the *chain*, and contains n integers c1, ..., cn.The movie theather is not arbitrarily large, so you can assume that the absolute value of these coordinates are not greater than 104.\n\n## Output\n\nPrint who wins the argument, that is, print \"Yan\" if the distance between the floor and the foot is *not greater* than the distance between the floor and the chain, or \"MaratonIME\" otherwise.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N \\in \\mathbb{Z}^+ $ be the number of students.  \nLet $ K_i \\in \\mathbb{Z}^+ $ be the price the $ i $-th student must pay.  \nLet $ F_{i,j} \\in \\mathbb{Z}_{\\geq 0} $ be the number of notes of denomination $ d_j $ given by the $ i $-th student, where $ d = [1, 5, 10, 20, 50] $.  \n\nLet $ C \\in \\mathbb{Z}_{\\geq 0} $ be the cashier’s cumulative change reserve (initially 0).  \n\n**Constraints**  \n1. $ 1 \\leq N \\leq 10^5 $  \n2. $ 0 \\leq F_{i,j} \\leq 100 $ for all $ i \\in \\{1, \\dots, N\\}, j \\in \\{1, \\dots, 5\\} $  \n3. For each student $ i $, the total paid is strictly greater than $ K_i $:  \n   $$\n   \\sum_{j=1}^5 F_{i,j} \\cdot d_j > K_i\n   $$  \n   and removing any single note makes it strictly less:  \n   $$\n   \\sum_{j=1}^5 F_{i,j} \\cdot d_j - d_k < K_i \\quad \\forall k \\text{ such that } F_{i,k} > 0\n   $$\n\n**Objective**  \nFor each student $ i = 1 $ to $ N $:  \n- Compute total payment: $ P_i = \\sum_{j=1}^5 F_{i,j} \\cdot d_j $  \n- Compute change due: $ \\Delta_i = P_i - K_i $  \n- Update cashier’s reserve: $ C \\leftarrow C + K_i $ (cash received)  \n- Check if $ C \\geq \\Delta_i $; if not, return **no**  \n- If sufficient, update: $ C \\leftarrow C - \\Delta_i $  \n\nIf all students are processed successfully, return **yes**.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10098H","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}