{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e Matt is playing a naive computer game with his deeply loved pure girl.\u003cbr\u003e\u003cbr\u003e The playground is a rectangle with walls around. Two balls are put in different positions inside the rectangle. The balls are so tiny that their volume can be ignored. Initially, two balls will move with velocity (1, 1). When a ball collides with any side of the rectangle, it will rebound without loss of energy. The rebound follows the law of refiection (i.e. the angle at which the ball is incident on the wall equals the angle at which it is reflected).\u003cbr\u003e\u003cbr\u003e After they choose the initial position, Matt wants you to tell him where will the two balls collide for the first time.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":" The first line contains only one integer T which indicates the number of test cases.\u003cbr\u003e\u003cbr\u003e For each test case, the first line contains two integers x and y. The four vertices of the rectangle are (0, 0), (x, 0), (0, y) and (x, y). (1 ≤ x, y ≤ 10\u003csup\u003e5\u003c/sup\u003e)\u003cbr\u003e\u003cbr\u003eThe next line contains four integers x\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e. The initial position of the two balls is (x\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e1\u003c/sub\u003e) and (x\u003csub\u003e2\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e). (0 ≤ x\u003csub\u003e1\u003c/sub\u003e, x\u003csub\u003e2\u003c/sub\u003e ≤ x; 0 ≤ y\u003csub\u003e1\u003c/sub\u003e, y\u003csub\u003e2\u003c/sub\u003e ≤ y)"}},{"title":"Output","value":{"format":"HTML","content":" For each test case, output “Case #x:” in the first line, where x is the case number (starting from 1). \u003cbr\u003e\u003cbr\u003e In the second line, output “Collision will not happen.” (without quotes) if the collision will never happen. Otherwise, output two real numbers x\u003csub\u003ec\u003c/sub\u003e and y\u003csub\u003ec\u003c/sub\u003e, rounded to one decimal place, which indicate the position where the two balls will first collide."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\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\r\n10 10\r\n1 1 9 9\r\n10 10\r\n0 5 5 10\r\n10 10\r\n1 0 1 10\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1:\r\n6.0 6.0\r\nCase #2:\r\nCollision will not happen.\r\nCase #3:\r\n6.0 5.0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"In first example, two balls move from (1, 1) and (9, 9) both with velocity (1, 1), the ball starts from (9, 9) will rebound at point (10, 10) then move with velocity (\u0026amp;#8722;1, \u0026amp;#8722;1). The two balls will meet each other at (6, 6).\u003cbr\u003e"}}]}