{"raw_statement":[{"iden":"statement","content":"You've been selected to be the recipient of Wegman's shopping spree program! The only caveat is that you have to be continuously moving through the building at all times, through the different sections in a circular pattern, so you will only have time to grab one item from each section. It will also take some time for you to move to the different locations of the store, and luckily, this Wegmans only has 3 sections, as the architect designing this location was lazy with his design. \n\nYou want to know how many loops it will take you to get a certain amount of different types of items.\n\nThe first line will contain an integer $n$, which denotes the amount of test cases that will follow. These test cases will each contain 3 different, space-separated integers denoting the amount of different items you will need to complete the shopping list.\n\nThe first line will always be Produce $p$, the second will be Meat $m$, and the third will be dry goods $d$.\n\nReturn the amount of loops it will take for you to complete your shopping list.\n\n"},{"iden":"input","content":"The first line will contain an integer $n$, which denotes the amount of test cases that will follow. These test cases will each contain 3 different, space-separated integers denoting the amount of different items you will need to complete the shopping list.The first line will always be Produce $p$, the second will be Meat $m$, and the third will be dry goods $d$."},{"iden":"output","content":"Return the amount of loops it will take for you to complete your shopping list."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, n\\} $, let $ (p_k, m_k, d_k) \\in \\mathbb{Z}_{>0}^3 $ denote the required quantities of Produce, Meat, and Dry Goods, respectively.\n\n**Constraints**  \n1. $ 1 \\le n \\le 1000 $  \n2. For each $ k \\in \\{1, \\dots, n\\} $: $ p_k, m_k, d_k \\ge 1 $\n\n**Objective**  \nFor each test case $ k $, compute the minimum number of loops $ L_k $ such that:  \n$$\nL_k = \\max(p_k, m_k, d_k)\n$$","simple_statement":"You need to collect p items from Produce, m from Meat, and d from Dry Goods. You visit the sections in order: Produce → Meat → Dry Goods → Produce → ... in a loop. Each loop, you grab one item from each section. How many full loops do you need to get at least the required number of each item?","has_page_source":false}