Advertisement
Shiam7777777

Untitled

Feb 9th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. // B
  2.  
  3. #include <bits/stdc++.h>
  4. using namespace std;
  5. #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  6. #define ll long long
  7. #define ld double
  8. #define llu long long unsigned
  9.  
  10. int main()
  11. {
  12. fast;
  13. int t;
  14. // cout<<fixed<<setprecision(10)<<acos(-1)<<endl;
  15. cin>>t;
  16. int count = 0;
  17. while( t-- )
  18. {
  19. ld m , d;
  20. cin>>m>>d;
  21. ld v = m / d;
  22. ld radius = v / (4.0/3.0 * acos(-1));
  23. radius = pow( radius , 1.0/3.0 );
  24. cout<<"Case "<<++count<<": "<<fixed<<setprecision(4)<<4.0*acos(-1)*pow( radius , 2 )<<endl;
  25. }
  26. return 0;
  27. }
  28.  
  29. // C
  30.  
  31. #include <bits/stdc++.h>
  32. using namespace std;
  33. #define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  34. #define ll long long
  35. #define ld double
  36. #define llu long long unsigned
  37.  
  38. int main()
  39. {
  40. fast;
  41. int t;
  42. cin>>t;
  43. int count = 0;
  44. while( t-- )
  45. {
  46. ld r;
  47. cin>>r;
  48. ld radius1 = sqrt(r*r + r*r)/2;
  49. // cout<<radius1<<endl;
  50. ld radius2 = sqrt(radius1*radius1 + radius1*radius1)/2;
  51. // cout<<radius2<<endl;
  52. ld overall = acos(-1) * pow( radius2 , 2 ) * 0.5;
  53. ld quarter1 = acos(-1) * pow( radius1 , 2 ) / 4;
  54. ld extras = quarter1 - radius1 * radius1 * 0.5;
  55. cout<<"Case "<<++count<<": ";
  56. cout<<fixed<<setprecision(4)<<overall-extras<<endl;
  57. }
  58. return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement