Advertisement
Guest User

Untitled

a guest
Apr 8th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.01 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. #define FOR(i,a,b) for(int i=(a);i<(b);++i)
  4. #define FORD(i, a, b) for(int i = (a); i >= (b); --i)
  5. #define VAR(v, i) __typeof(i) v=(i)
  6. #define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
  7. #define all(v) (v).begin(),(v).end()
  8.  
  9. #define PII pair<int,int>
  10. #define mp make_pair
  11. #define st first
  12. #define nd second
  13. #define pb push_back
  14. #define lint long long int
  15. #define VI vector<int>
  16.  
  17. #define debug(x) {cerr <<#x <<" = " <<x <<endl; }
  18. #define debug2(x,y) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y <<endl; }
  19. #define debug3(x,y,z) {cerr <<#x <<" = " <<x << ", "<<#y<<" = "<< y << ", " << #z << " = " << z <<endl; }
  20. #define debugv(x) {{cerr <<#x <<" = "; FORE(itt, (x)) cerr <<*itt <<", "; cerr <<endl; }}
  21. #define debugt(t,n) {{cerr <<#t <<" = "; FOR(it,0,(n)) cerr <<t[it] <<", "; cerr <<endl; }}
  22.  
  23. #define make( x) int (x); scanf("%d",&(x));
  24. #define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
  25. #define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
  26. #define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
  27. #define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);}
  28. #define IOS ios_base::sync_with_stdio(0)
  29. #define HEAP priority_queue
  30.  
  31. #define read( x) scanf("%d",&(x));
  32. #define read2( x, y) scanf("%d%d",&(x),&(y));
  33. #define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
  34. #define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
  35. #define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}
  36.  
  37.  
  38. using namespace std;
  39.  
  40. const int max_n = 1e3 + 5;
  41.  
  42.  
  43.  
  44. void solve() {
  45.     double s;
  46.     scanf("%lf", &s);
  47.     printf("0 0 0.5\n");
  48.     double x = sqrt(2);
  49.     double alpha = M_PI/4 - acos(s/x);
  50.     complex<double> p1(0.5, 0), p2(0,0.5);
  51.     complex<double> rotate(cos(alpha), sin(alpha));
  52.     p1 *= rotate; p2 *= rotate;
  53.     printf("%.17lf %.17lf 0\n", p1.real(), p1.imag() );
  54.     printf("%.17lf %.17lf 0\n", p2.real(), p2.imag() );
  55.    
  56. }
  57.  
  58. int main() {
  59.     make(t);
  60.     FOR(tt,1,t+1) {
  61.         printf("Case #%d: ", tt);
  62.         solve();
  63.     }
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement