{"problem":{"name":"055. Train-ficiency","description":{"content":"A train station needs your help to maximize its efficiency. The train station can only have 100 train carts parked on a track at once, and it is imperative that the tracks are fully filled as to maxim","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269055"},"statements":[{"statement_type":"Markdown","content":"A train station needs your help to maximize its efficiency. The train station can only have 100 train carts parked on a track at once, and it is imperative that the tracks are fully filled as to maximize profit. Given a list of trains and their lengths (number of train carts) print the pairs of trains that will most effectively fill the station.\n\nYou will be given 4 integers separated by spaces. Each of these integers represents the number of cars on a train.\n\nPrint the pairs of trains.\n\nIn the first case, Train 1 must be combined with Train 4, as 25 cars plus 75 cars adds up to 100 cars. Train 3 must be combined with Train 4, as 50 cars plus 50 cars equals 100 cars.\n\nAlso, assume that there is always a way to fill each track with 100 trains. Make sure the output format puts the trains in ascending order (i.e. Train 1 and Train 3, not Train 3 and Train 1).\n\n## Input\n\nYou will be given 4 integers separated by spaces. Each of these integers represents the number of cars on a train.\n\n## Output\n\nPrint the pairs of trains.\n\n[samples]\n\n## Note\n\nIn the first case, Train 1 must be combined with Train 4, as 25 cars plus 75 cars adds up to 100 cars. Train 3 must be combined with Train 4, as 50 cars plus 50 cars equals 100 cars.Also, assume that there is always a way to fill each track with 100 trains. Make sure the output format puts the trains in ascending order (i.e. Train 1 and Train 3, not Train 3 and Train 1).","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T = \\{t_1, t_2, t_3, t_4\\} $ be a tuple of four positive integers representing the lengths (number of carts) of four trains.  \nLet $ S = \\{ (i,j) \\mid 1 \\leq i < j \\leq 4 \\text{ and } t_i + t_j = 100 \\} $ be the set of valid train pairs.\n\n**Constraints**  \n1. $ t_i \\in \\mathbb{Z}^+ $ for $ i \\in \\{1,2,3,4\\} $  \n2. There exists at least one pair $ (i,j) \\in S $ such that $ t_i + t_j = 100 $  \n3. Exactly two disjoint pairs $ (i,j), (k,l) \\in S $ exist, partitioning $ \\{1,2,3,4\\} $\n\n**Objective**  \nOutput the two pairs in $ S $, sorted lexicographically (i.e., each pair $ (i,j) $ with $ i < j $, and the set of pairs ordered by increasing first index).","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269055","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}