{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n div.illustration {\n float: right;\n padding-left: 20px;\n }\n div.illustration .illustration {\n width: 100%;\n border-radius: 4px;\n }\n pre {\n display: block;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n color: #333;\n word-break: break-all;\n word-wrap: break-word;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv style\u003d\"width:33.00%\" class\u003d\"illustration\"\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/664a811a3c6f1609a400e88083f8890b?v\u003d1715181667\" alt\u003d\"/problems/robotopia/file/statement/en/img-0001.jpg\" class\u003d\"illustration\"\u003e\n\n \n \u003c/div\u003e\n\n \u003cp\u003eIn the wonderful land of Robotopia, life is better than\n ever. This is thanks to all the robots, who work hard together.\n Different types of robots come in different forms, that is,\n different numbers of arms and different numbers of legs. By\n day, when they are working, robots are grouped so they can be\n assigned to different tasks. But by night, it is your job to\n count how many robots there are of each type within each group.\n Robots are naughty and energetic; they don’t like to stand\n still and it is difficult to count them. After many exhausting\n attempts, you are finally able to count how many arms and how\n many legs there are in total.\u003c/p\u003e\n\n \u003cp\u003eWe know each group consists of exactly two different types\n of robots, with at least one of each type in each group. We\n also know the number of arms and legs that each type of robot\n has. Can you find out how many robots of each type there are\n within each group?\u003c/p\u003e\n\n \u003ch2\u003eInput\u003c/h2\u003e\n\n \u003cp\u003eThe first line contains an integer \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e \u003cspan class\u003d\"tex2jax_process\"\u003e$( 1\n \\leq n \\leq 100)$\u003c/span\u003e. The following \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e lines each contain one test case.\n Each has six integers: \u003cspan class\u003d\"tex2jax_process\"\u003e$l_1~ a_1~\n l_2~ a_2~ l_ t~ a_ t$\u003c/span\u003e, where \u003cspan class\u003d\"tex2jax_process\"\u003e$l_1$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$a_1$\u003c/span\u003e are the number of legs and arms\n (respectively) for the first type of robot, \u003cspan class\u003d\"tex2jax_process\"\u003e$l_2$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$a_2$\u003c/span\u003e are those for the second type,\n and \u003cspan class\u003d\"tex2jax_process\"\u003e$l_ t$\u003c/span\u003e and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$a_ t$\u003c/span\u003e are the total\n number of observed legs and arms. All values are in the range\n \u003cspan class\u003d\"tex2jax_process\"\u003e$[1, 10\\, 000]$\u003c/span\u003e.\u003c/p\u003e\n\n \u003ch2\u003eOutput\u003c/h2\u003e\n\n \u003cp\u003eFor each test case output two positive integers denoting the\n number of each of the two types of robots. Give first the count\n for the first type listed. If the test case has no solution or\n multiple solutions, output “\u003ctt\u003e?\u003c/tt\u003e” (a question mark).\u003c/p\u003e\n\n \u003ch2\u003eSample 1\u003c/h2\u003e\u003cbody\u003e\u003ctable class\u003d\"vjudge_sample\"\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n2 1 4 1 16 5\n3 2 5 1 9 4\n1 2 3 6 8 16\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2 3\n?\n?\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}