{"problem":{"name":"H. The Job Interview","description":{"content":"*Bakkar* has just finished his military service. And as we know that he had a job offer from the same company he interned at when he was at college. But because of the delay caused by the military ser","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":15000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10028H"},"statements":[{"statement_type":"Markdown","content":"*Bakkar* has just finished his military service. And as we know that he had a job offer from the same company he interned at when he was at college. But because of the delay caused by the military service the company wants to make sure that *Bakkar* is still a good candidate for the position. They know that *Bakkar* is very talented and a hard working person. That's why they didn’t cancel the job offer and delayed his start date a year later. But they decided to conduct one final technical interview to ensure his readiness.\n\nThe interview had one problem solving question. The interviewer introduced himself and had a little conversation with *Bakkar* to update him with the company's state and to break any interview tension that *Bakkar* may have. Afterwards the interviewer introduced a problem to *Bakkar* on a whiteboard. The problem stated that a statistician was building a perfect random number generator machine using two 6-sided die (the plural of dice). He throws the 2 dice and the output is the sum of the top faces of each dice. The statistician uses any die as long as it has 6 distinct positive numbers on its faces.\n\nThe main problem lies that the statistician forgot the numbers on the faces of both die. But he can still know all the possible unique sums the machine can generate. *Bakkar* is now required to use this information to find the original values on the faces of both die. He will be given all the possible unique sums the machine can generate, and his task is to find any configuration for two die that will produce such sums if they are used by the machine.\n\n*Bakkar* solved the problem and the interviewer is going to test it using some test cases he already generated. Do you think *Bakkar* will get the job and be able to marry *Maymona*?!! Let's see ;).\n\nThe 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 (1  ≤  *T*  ≤  100). Followed by *T* test cases, each test case starts with a line containing a single integer *N*, the number of possible sums (1  ≤  *N*  ≤  36). The next line contains *N* distinct positive integers, sorted in ascending order. Each integer *S_i* represents one possible sum (2  ≤  *S_i*  ≤  2000).\n\nFor each test case print a line containing \"Case n:\" (without the quotes) where n is the test case number (starting from 1), followed by 2 lines. Each line contains the 6 values on the faces of one dice in any order. It is safe to assume that a solution always exists. If there are multiple solutions, print any.\n\n## Input\n\nThe 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 (1  ≤  *T*  ≤  100). Followed by *T* test cases, each test case starts with a line containing a single integer *N*, the number of possible sums (1  ≤  *N*  ≤  36). The next line contains *N* distinct positive integers, sorted in ascending order. Each integer *S_i* represents one possible sum (2  ≤  *S_i*  ≤  2000).\n\n## Output\n\nFor each test case print a line containing \"Case n:\" (without the quotes) where n is the test case number (starting from 1), followed by 2 lines. Each line contains the 6 values on the faces of one dice in any order. It is safe to assume that a solution always exists. If there are multiple solutions, print any.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ N_k \\in \\mathbb{Z} $ be the number of distinct sums.  \n- Let $ S_k = \\{s_1, s_2, \\dots, s_{N_k}\\} $ be a set of $ N_k $ distinct positive integers, sorted ascendingly, representing all possible unique sums of two 6-sided dice.  \n\nLet $ A = \\{a_1, a_2, \\dots, a_6\\} \\subset \\mathbb{Z}^+ $ and $ B = \\{b_1, b_2, \\dots, b_6\\} \\subset \\mathbb{Z}^+ $ be the multisets of face values of the two dice.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 100 $  \n2. For each test case $ k $:  \n   - $ 1 \\le N_k \\le 36 $  \n   - $ 2 \\le s_i \\le 2000 $ for all $ s_i \\in S_k $  \n   - $ A $ and $ B $ each contain exactly 6 positive integers.  \n   - $ S_k = \\{ a_i + b_j \\mid a_i \\in A, b_j \\in B \\} $  \n\n**Objective**  \nFor each test case $ k $, find any pair of multisets $ A $ and $ B $ such that:  \n$$\n\\{ a_i + b_j \\mid a_i \\in A, b_j \\in B \\} = S_k\n$$  \nOutput $ A $ and $ B $, each as a line of 6 values in any order.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10028H","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}