Submission
# | When | Author | Problem | Language | CPU | Memory | |
---|---|---|---|---|---|---|---|
20823 | 2024-06-09 08:49:17 | AHAMMED_99 | Spinning Spinners | C | 0 ms | 1928 kb | Wrong Answer - 1 |
Source Code
#include <stdio.h> #include <math.h> #define PI 3.1416 int main() { int T; for (int case_no = 1; case_no <= T; case_no++) { int x, d, h, w, a; // Calculate the distance to the farthest point of the rectangle double half_h = h / 2.0; double half_w = w / 2.0; // Calculate the distance to the farthest point of the equilateral triangle double triangle_farthest = (x - d) + triangle_height / 3.0; // centroid is at 1/3 of the height // Determine the maximum radius double max_radius = fmax(rectangle_farthest, triangle_farthest); // Calculate the area double area = PI * max_radius * max_radius; // Print the result } return 0; }