shipu_a

Div 1 Problem J

Jan 15th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.44 KB | None | 0 0
  1. /*-----------------------------------------*/
  2. //Author      : Mir Riyanul Islam (Riyan)  
  3. //University  : AIUB                      
  4. //E-mail      : [email protected]        
  5. //Problem ID  : 10310                        
  6. //Problem Name: Dog and Gopher                          
  7. //Algorithm   : Geometry                          
  8. /*-----------------------------------------*/
  9. #pragma warning (disable : 4786)
  10. #pragma comment(linker, "/STACK:16777216")
  11. #include <set>
  12. #include <map>
  13. #include <list>
  14. #include <cmath>
  15. #include <ctime>
  16. #include <deque>
  17. #include <queue>
  18. #include <stack>
  19. #include <cctype>
  20. #include <cstdio>
  21. #include <string>
  22. #include <vector>
  23. #include <cassert>
  24. #include <cstdlib>
  25. #include <cstring>
  26. #include <sstream>
  27. #include <iostream>
  28. #include <algorithm>  
  29.  
  30. using namespace std;
  31.  
  32.  
  33.  
  34. const double EPS = 1e-11;
  35. const int INF = ( 1<<29 );
  36. const double PI = 2 * acos( 0.0 );
  37.  
  38. int MAX( int a , int b ) { return a > b ? a : b;  }
  39. int MIN( int a , int b ) { return a < b ? a : b;  }
  40. void SWAP( int &a , int &b ) { int t = a; a = b; b = t; }
  41. int GCD( int a , int b ) { while( b ) { b ^= a ^= b ^= a %= b; } return a; }
  42.  
  43. int main() {
  44.     freopen( "input.txt" , "r" , stdin );
  45.     freopen( "output.txt" , "w" , stdout );
  46.     int tc , cn = 0;
  47.     double r;
  48.     scanf( "%d" , &tc );
  49.     while( tc-- ) {
  50.         scanf( "%lf" , &r );
  51.         printf( "Case %d: %.2lf\n" , ++cn , ( r * r ) * ( PI - ( sqrt( 3.0 ) / 2.0 ) ) );      
  52.     }
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment