fork download
  1. #include <iostream>
  2. #include <math.h>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.  
  10. int test;
  11. cin >> test;
  12. while(test--)
  13. {
  14. int len;
  15. cin >> len;
  16. float wdt = (float)(len * 60)/100.00;
  17. float rad = (float)(len * 20)/100.00;
  18.  
  19. float red = (float)(acos(-1) * rad * rad);
  20. float grn = (float)(len * wdt);
  21.  
  22. printf("%.2f %.2f\n", red, grn - red );
  23. }
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2900KB
stdin
16
10
1
11
13
100
33
10
20
30
40
50
60
70
80
97
1000
stdout
12.57 47.43
0.13 0.47
15.21 57.39
21.24 80.16
1256.64 4743.36
136.85 516.55
12.57 47.43
50.27 189.73
113.10 426.90
201.06 758.94
314.16 1185.84
452.39 1707.61
615.75 2324.25
804.25 3035.75
1182.37 4463.03
125663.70 474336.30