{"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\u003ci\u003eThis is the job the bear finds\u003cbr\u003eThis is the job the bear finds\u003cbr\u003eThis is the job the bear finds\u003cbr\u003eNot with a code but a brick.\u003c/i\u003e\u003cbr\u003e\u003cbr\u003e\u003cpre\u003e - Kenneth Snow, The Hollow Bear\u003c/pre\u003e\u003cbr\u003eBearchild is working in a construction team. Life is hard, and his job is just carrying bricks from here to there, what a waste of time! So, our lovely Bearchild has invented a strange machine to help him.\u003cbr\u003eThe machine consists three parts: A rope, a little, round pulley (regarded as points) and a big pulley which is a convex hull (Bearchild is short of money and can\u0027t make his big pulley round!).\u003cbr\u003eOne end of the rope is fixed with bricks, the rope goes around the small pulley, and finally connects the big pulley on its contour. It\u0027s guaranteed that the small pulley is located to the left of the big one.\u003cbr\u003eYou can see that when the big pulley spins clockwise around its center of gravity, the bricks will be pulled up, and finally reach the small pulley as the destination. Note that the rope will circle around the contour of the big pulley as it spins.\u003cbr\u003eSee the picture for more information, there will be no collision when spinning.\u003cbr\u003e\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/6e5ebfe729962f71556fdf5c649e4ccc?v\u003d1714435239\"\u003e\u003c/center\u003e \u003cbr\u003eIn this problem, first of all we let the pulley spin for one or more circles so the rope becomes tight.\u003cbr\u003eAfter that, the positions of the two pulleys are given. Then you have to deal a lot of queries, for each query, the distance from the bricks and the small pulley (also as the destination) is given.\u003cbr\u003eYour task is to calculate the degree the pulley has yet to spin to pull the bricks to the destination.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line has a number T (T \u0026lt;\u003d 1000) , indicating the number of test cases.\u003cbr\u003eFor each test case, first line is a number n, which is the number of points of the big pulley (As a convex hull). Then n lines follow, each with two numbers as the x and y coordinate of each point.\u003cbr\u003eThose points are given in counter-clockwise order. Then a line with two numbers, which are the x and y coordinate of the small pulley. Those coordinates are in the range [-1000000, 1000000].\u003cbr\u003eThen a number m indicating the number of queries.\u003cbr\u003eFor next q lines, each contains a number l (0 \u0026lt; l \u0026lt; 10\u003csup\u003e9\u003c/sup\u003e), which is the distance between the bricks and the small pulley.\u003cbr\u003eFor 90% of the data, we have n,m \u0026lt;\u003d 100, All the data have n \u0026lt;\u003d 10\u003csup\u003e4\u003c/sup\u003e, m \u0026lt;\u003d 10\u003csup\u003e5\u003c/sup\u003e, and all the numbers in the input are integers."}},{"title":"Output","value":{"format":"HTML","content":"For every case, you should output \"Case #t:\" at first, without quotes. The \u003ci\u003et\u003c/i\u003e is the case number starting from 1.\u003cbr\u003eThen q lines each answers a query in the Input, which should be printed accurately rounded to three decimals."}},{"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\u003e2\r\n4\r\n0 0\r\n1 0\r\n1 1\r\n0 1\r\n-1 2\r\n2\r\n1\r\n4\r\n3\r\n0 0\r\n1 1\r\n-1 1\r\n-2 1\r\n3\r\n1\r\n2\r\n3\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1:\r\n90.000\r\n360.000\r\nCase #2:\r\n64.413\r\n140.446\r\n233.660\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}