/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
System.
out.
println(getArea
(0,
1,
10)); System.
out.
println(getArea
(1,
1,
10)); System.
out.
println(getArea
(1,
0,
10)); System.
out.
println(getArea
(1,
-1,
10)); System.
out.
println(getArea
(0,
-1,
10)); System.
out.
println(getArea
(-1,
-1,
10)); System.
out.
println(getArea
(-1,
0,
10)); System.
out.
println(getArea
(-1,
1,
10)); }
static int getArea(double xcoord, double ycoord , double radius) {
if(xcoord*xcoord + ycoord*ycoord > radius*radius)
return -1;
double angle
=Math.
PI/2-Math.
atan2(ycoord, xcoord
); if(angle < 0)
int segments = 12;
double angle_one_segment
=2*Math.
PI/segments
; return 1 + (int)(angle/angle_one_segment);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVN5c3RlbS5vdXQucHJpbnRsbihnZXRBcmVhKDAsMSwxMCkpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihnZXRBcmVhKDEsMSwxMCkpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihnZXRBcmVhKDEsMCwxMCkpOwoJCVN5c3RlbS5vdXQucHJpbnRsbihnZXRBcmVhKDEsLTEsMTApKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oZ2V0QXJlYSgwLC0xLDEwKSk7CgkJU3lzdGVtLm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