{"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 are programming an autonomous rocket powered hovercraft.\n The vehicle can travel very, very fast, but turning is\n difficult. Since it’s hovering, it turns by firing directional\n thrusters, which will turn the vehicle whether it is moving\n forward or is stationary.\u003c/p\u003e\n \u003cp\u003eThe salt flats on which you’re testing have been mapped with\n a 2D Cartesian grid. The hovercraft starts at location\n \u003cspan class\u003d\"tex2jax_process\"\u003e$(0{,}0)$\u003c/span\u003e on this grid,\n facing in the positive \u003cspan class\u003d\"tex2jax_process\"\u003e$X$\u003c/span\u003e\n direction. Your job is to get the vehicle to another location\n \u003cspan class\u003d\"tex2jax_process\"\u003e$(x{,}y)$\u003c/span\u003e on the\n flats.\u003c/p\u003e\n \u003cp\u003eThe hovercraft has a fixed ground speed \u003cspan class\u003d\"tex2jax_process\"\u003e$v$\u003c/span\u003e miles per second and a fixed rate\n of rotation \u003cspan class\u003d\"tex2jax_process\"\u003e$w$\u003c/span\u003e radians\n per second. Due to the power of the rockets both for\n acceleration and deceleration, it can attain its maximum speed\n virtually instantaneously, and come to a stop from maximum\n speed just as quickly. Likewise, it can begin rotating at its\n fixed rate instantaneously, and stop just as quickly. It can\n rotate either clockwise or counter-clockwise.\u003c/p\u003e\n \u003cp\u003eYou must figure out the minimum amount of time to get the\n vehicle to its target. The program which controls the vehicle\n can start forward motion, stop forward motion, start rotating,\n and stop rotating, each exactly once. Note that\n starting/stopping forward movement can be independent of\n starting/stopping rotation.\u003c/p\u003e\n \u003ch2\u003eInput\u003c/h2\u003e\n \u003cp\u003eEach test case will consist of exactly two lines.\u003c/p\u003e\n \u003cp\u003eThe first line will contain two space-separated integers\n \u003cspan class\u003d\"tex2jax_process\"\u003e$x$\u003c/span\u003e and \u003cspan class\u003d\"tex2jax_process\"\u003e$y$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$-1\\, 000\\! \\le \\! x,y\\! \\le \\! 1\\, 000,\n (x{,}y){\\neq }(0{,}0)$\u003c/span\u003e), which indicate the location on\n the grid mapped onto the flats that you are trying to reach, in\n units of miles.\u003c/p\u003e\n \u003cp\u003eThe second line of input will contain two space-separated\n real numbers with exactly two decimal places: \u003cspan class\u003d\"tex2jax_process\"\u003e$v$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0.01\\! \\le \\! v\\! \\le \\! 10.00$\u003c/span\u003e) and\n \u003cspan class\u003d\"tex2jax_process\"\u003e$w$\u003c/span\u003e (\u003cspan class\u003d\"tex2jax_process\"\u003e$0.01\\! \\le \\! w\\! \\le \\! 10.00$\u003c/span\u003e),\n where \u003cspan class\u003d\"tex2jax_process\"\u003e$v$\u003c/span\u003e is the fixed\n speed of travel in miles per second, and \u003cspan class\u003d\"tex2jax_process\"\u003e$w$\u003c/span\u003e is the fixed rate of rotation in\n either direction in radians per second.\u003c/p\u003e\n \u003ch2\u003eOutput\u003c/h2\u003e\n \u003cp\u003eOutput a single real number, which is the minimum amount of\n time (in seconds) it would take get the hovercraft from\n \u003cspan class\u003d\"tex2jax_process\"\u003e$(0{,}0)$\u003c/span\u003e to \u003cspan class\u003d\"tex2jax_process\"\u003e$(x{,}y)$\u003c/span\u003e subject to the constraints.\n Your answer will be accepted if it is within an absolute error\n of \u003cspan class\u003d\"tex2jax_process\"\u003e$10^{-3}$\u003c/span\u003e.\u003c/p\u003e\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\u003e20 0\n1.00 0.10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e20.00000000\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\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\u003e-10 10\n10.00 1.00\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3.14159265\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\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\u003e0 20\n1.00 0.10\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e28.26445910\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n \u003ch2\u003eSample 4\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\u003e-997 -3\n5.64 2.15\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e177.76915187\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/body\u003e\n "}}]}