{"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 \u003cp\u003eYou have two pictures of an unusual kind of clock. The clock\n has \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e hands, each having\n the same length and no kind of marking whatsoever. Also, the\n numbers on the clock are so faded that you can’t even tell\n anymore what direction is up in the picture. So the only thing\n that you see on the pictures, are \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e shades of the \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e hands, and nothing else.\u003c/p\u003e\n\n \u003cp\u003eYou’d like to know if both images might have been taken at\n exactly the same time of the day, possibly with the camera\n rotated at different angles.\u003c/p\u003e\n\n \u003ch2\u003eTask\u003c/h2\u003e\n\n \u003cp\u003eGiven the description of the two images, determine whether\n it is possible that these two pictures could be showing the\n same clock displaying the same time.\u003c/p\u003e\n\n \u003ch2\u003eInput\u003c/h2\u003e\n\n \u003cp\u003eThe first line contains a single integer \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$2\n \\leq n \\leq 200\\, 000$\u003c/span\u003e), the number of hands on the\n clock.\u003c/p\u003e\n\n \u003cp\u003eEach of the next two lines contains \u003cspan class\u003d\"tex2jax_process\"\u003e$n$\u003c/span\u003e integers \u003cspan class\u003d\"tex2jax_process\"\u003e$a_ i$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0 \\leq a_ i \u0026lt; 360\\, 000$\u003c/span\u003e),\n representing the angles of the hands of the clock on one of the\n images, in thousandths of a degree. The first line represents\n the position of the hands on the first image, whereas the\n second line corresponds to the second image. The number\n \u003cspan class\u003d\"tex2jax_process\"\u003e$a_ i$\u003c/span\u003e denotes the angle\n between the recorded position of some hand and the upward\n direction in the image, measured clockwise. Angles of the same\n clock are distinct and are not given in any specific order.\u003c/p\u003e\n\n \u003ch2\u003eOutput\u003c/h2\u003e\n\n \u003cp\u003eOutput one line containing one word: \u003ctt\u003epossible\u003c/tt\u003e if\n the clocks could be showing the same time, \u003ctt\u003eimpossible\u003c/tt\u003e\n otherwise.\u003c/p\u003e\n\n \u003cdiv id\u003d\"fig:sample2\" class\u003d\"figure\"\u003e\n \u003ccenter\u003e\n \u003cimg src\u003d\"CDN_BASE_URL/8d120d9f6f9a205fa71b51bd9e3d729a?v\u003d1715465065\" alt\u003d\"\\includegraphics[width\u003d0.45\\textwidth ]{sample2}\" style\u003d\"width:45.00%\"\u003e\n\n \u003cdiv class\u003d\"caption\"\u003e\n \u003cb\u003eFigure 1\u003c/b\u003e: Sample input 2\n \u003c/div\u003e\n \u003c/center\u003e\n \u003c/div\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\u003e6\n1 2 3 4 5 6\n7 6 5 4 3 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eimpossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n\n \u003ch2\u003eSample 2\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\u003e2\n0 270000\n180000 270000\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003epossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n\n \u003ch2\u003eSample 3\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\u003e7\n140 130 110 120 125 100 105\n235 205 215 220 225 200 240\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eimpossible\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}