{"raw_statement":[{"iden":"statement","content":"Omar has a deck of cards. Every card has a unique integer number written on it. He says that his cards are numbered starting from 1, and if a card with number N exists, then a card with number N + 1 exists. Yes he may have an infinite sequence ! \n\nYesterday when he went to school, his little brother Samir played with his cards by sorting them into two boxes according to the numbers written on them by repeating the following two steps:\n\nFirst box : 1, 3, 4, 5, 7, ... \n\nSecond box : 2, 6, 8, 10, 14, ... \n\nOmar came back home and he asked Samir for the card with number Q written on it. Help Samir to find out in which box he can find the required card. \n\nYour program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases . \n\nT lines follow, each describing a test case consisting of a single integer Q (1 ≤ Q ≤ 1018)\n\nFor every test case print \"First Box\" if the card is in the first box or \"Second Box\" otherwise.\n\n"},{"iden":"input","content":"Your program will be tested on one or more test cases. The first line of the input will be a single integer T, the number of test cases . T lines follow, each describing a test case consisting of a single integer Q (1 ≤ Q ≤ 1018)"},{"iden":"output","content":"For every test case print \"First Box\" if the card is in the first box or \"Second Box\" otherwise."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ H, W \\in \\mathbb{R} $ be the height and width of the larger map.  \nLet $ P_1 = (x_1, y_1), P_2 = (x_2, y_2), P_3 = (x_3, y_3), P_4 = (x_4, y_4) $ be the coordinates of the four corners of the smaller map on the larger map, in order: lower left, lower right, upper right, upper left.\n\n**Constraints**  \n1. $ 10 \\leq H, W \\leq 1000 $  \n2. $ 0 < x_i < W $, $ 0 < y_i < H $ for $ i \\in \\{1,2,3,4\\} $  \n3. The quadrilateral $ P_1P_2P_3P_4 $ is a rectangle with the same dimensions and orientation as the smaller map.  \n4. The scale ratio $ r \\in [0.01, 0.99] $ satisfies $ \\frac{\\|P_2 - P_1\\|}{W} = \\frac{\\|P_4 - P_1\\|}{H} = r $\n\n**Objective**  \nFind a point $ (x_p, y_p) \\in \\mathbb{R}^2 $ such that its normalized position relative to the larger map equals its position relative to the smaller map’s local coordinate system. That is, if the smaller map is scaled and placed such that its corners coincide with $ P_1, P_2, P_3, P_4 $, then $ (x_p, y_p) $ is the fixed point of the affine transformation mapping the unit rectangle $ [0,1] \\times [0,1] $ to the rectangle $ P_1P_2P_3P_4 $, and also corresponds to the same physical location in both maps.\n\nThis point satisfies:  \n$$\n(x_p, y_p) = P_1 + x_p \\cdot (P_2 - P_1) + y_p \\cdot (P_4 - P_1)\n$$  \nwith the constraint that $ (x_p, y_p) $ lies in $ [0,1] \\times [0,1] $, and is invariant under the transformation from the unit square to the target rectangle.\n\nSolve for $ (x_p, y_p) $ such that:  \n$$\nx_p = \\frac{(x_2 - x_1) x_p + (x_4 - x_1) y_p + x_1}{W} \\cdot W \\\\\ny_p = \\frac{(y_2 - y_1) x_p + (y_4 - y_1) y_p + y_1}{H} \\cdot H\n$$\n\nRewriting as a linear system:  \n$$\nx_p = x_1 + x_p (x_2 - x_1) + y_p (x_4 - x_1) \\\\\ny_p = y_1 + x_p (y_2 - y_1) + y_p (y_4 - y_1)\n$$\n\nRearranged:  \n$$\nx_p (1 - (x_2 - x_1)) - y_p (x_4 - x_1) = x_1 \\\\\n- x_p (y_2 - y_1) + y_p (1 - (y_4 - y_1)) = y_1\n$$\n\nBut more cleanly:  \nDefine vectorially:  \nLet $ \\vec{u} = (x_2 - x_1, y_2 - y_1) $, $ \\vec{v} = (x_4 - x_1, y_4 - y_1) $  \nThen the point $ (x_p, y_p) $ in the unit square maps to:  \n$$\nT(x_p, y_p) = P_1 + x_p \\vec{u} + y_p \\vec{v}\n$$  \nWe seek $ (x_p, y_p) $ such that:  \n$$\n(x_p, y_p) = T(x_p, y_p)\n$$  \nSo:  \n$$\nx_p = x_1 + x_p (x_2 - x_1) + y_p (x_4 - x_1) \\\\\ny_p = y_1 + x_p (y_2 - y_1) + y_p (y_4 - y_1)\n$$\n\nThus, the system:  \n$$\nx_p (1 - (x_2 - x_1)) - y_p (x_4 - x_1) = x_1 \\\\\nx_p (y_1 - y_2) + y_p (1 - (y_4 - y_1)) = y_1\n$$\n\nLet:  \n$ a = 1 - (x_2 - x_1) $,  \n$ b = -(x_4 - x_1) $,  \n$ c = y_1 - y_2 $,  \n$ d = 1 - (y_4 - y_1) $\n\nThen:  \n$$\na x_p + b y_p = x_1 \\\\\nc x_p + d y_p = y_1\n$$\n\nSolve this 2×2 linear system for $ (x_p, y_p) $.\n\n**Final Objective**  \nFind $ (x_p, y_p) $ satisfying:  \n$$\n\\begin{cases}\nx_p (1 - (x_2 - x_1)) + y_p (-(x_4 - x_1)) = x_1 \\\\\nx_p (y_1 - y_2) + y_p (1 - (y_4 - y_1)) = y_1\n\\end{cases}\n$$","simple_statement":"Two rectangular maps of the same region, one smaller and one larger, are placed on a Cartesian plane. The smaller map’s four corners are given as points in the larger map’s coordinate system. Find a point that represents the same location on both maps — meaning, when the smaller map is scaled and aligned to match its four corners with the given points, this point lies in the exact same position on both maps. Print the coordinates of such a point.","has_page_source":false}