|
|
вернуться в форумWA #3 I'm getting wrong ans on test case 3. Can someone please give a hint? Here's my solution in Java: FastReader sc = new FastReader(System.in); double a = sc.nextDouble(); double r = sc.nextDouble(); double ans; if (r <= a / 2) { ans = Math.PI * r * r; } else { double angle = (2 * Math.PI) - (8 * Math.acos(a / (2 * r))); ans = (r * r * angle / 2) + (2 * a * Math.sqrt(r * r - a * a / 4)); } System.out.println(String.format("%.3f", ans)); |
|
|