fork download
  1. #include <cstdio>
  2. #include <cmath>
  3.  
  4. int main() {
  5. int T;
  6. scanf("%d", &T);
  7. for (int t = 0; t < T; ++t) {
  8. int W, H, N;
  9. scanf("%d%d%d", &W, &H, &N);
  10. double X, Y, R;
  11. scanf("%lf%lf%lf", &X, &Y, &R);
  12. double PI = 2 * acos(0.0);
  13. double res = 2 * PI;
  14. if (fabs(W - X) < R) {
  15. res -= 2 * acos((W - X) / R);
  16. }
  17. res *= R;
  18. printf("res = %.7lf\n", res);
  19. printf("cor = %.7lf\n", 2 * PI * R);
  20. printf("dif = %.7lf\n", fabs(2 * PI * R - res));
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.02s 2684KB
stdin
1
999 1000 1
64.18 64.18 934.82
stdout
res = 5873.6472610
cor = 5873.6472889
dif = 0.0000279