{"raw_statement":[{"iden":"statement","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"},{"iden":"input","content":"You will be given 4 integers separated by spaces. Each of these integers represents the number of cars on a train."},{"iden":"output","content":"Print the pairs of trains."},{"iden":"examples","content":"Input25 50 50 75\nOutputTrain 1 and Train 4\nTrain 2 and Train 3\nInput35 24 65 76\nOutputTrain 1 and Train 3\nTrain 2 and Train 4\n"},{"iden":"note","content":"In 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)."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**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).","simple_statement":"Given four train lengths, find two pairs of trains that each sum to 100. Output each pair with smaller train number first, sorted by the first train in ascending order.","has_page_source":false}