fork(3) download
  1. /***************************************/
  2. #include<cstdio>
  3. #include<cstdio>
  4. #include<iostream>
  5. #include<cstring>
  6. #include<string>
  7. #include<cstdlib>
  8. #include<cmath>
  9. #include<cassert>
  10. #include<ctime>
  11. #include<algorithm>
  12. #include<vector>
  13. #include<stack>
  14. #include<queue>
  15. #include<deque>
  16. #include<list>
  17. #include<set>
  18. #include<map>
  19. using namespace std;
  20.  
  21. #define sc(x) scanf("%c",&x)
  22. #define si(x) scanf("%d",&x)
  23. #define sl(x) scanf("%I64d",&x)
  24. #define sf(x) scanf("%f",&x)
  25. #define sd(x) scanf("%lf",&x)
  26. #define sld(x) scanf("%Lf",&x)
  27. #define ss(x) scanf("%s",x)
  28. #define pc(x) printf("%c",x)
  29. #define pi(x) printf("%d ",x)
  30. #define pl(x) printf("%I64d ",x)
  31. #define pf(x) printf("%f ",x)
  32. #define pd(x) printf("%lf ",x)
  33. #define pld(x) printf("%Lf ",x)
  34. #define ps(x) printf("%s ",x)
  35. #define pin(x) printf("%d\n",x)
  36. #define pln(x) printf("%I64d\n",x)
  37. #define pfn(x) printf("%f\n",x)
  38. #define pdn(x) printf("%lf\n",x)
  39. #define pldn(x) printf("%Lf\n",x)
  40. #define psn(x) printf("%s\n",x)
  41. #define pn() printf("\n")
  42. #define _p() printf(" ")
  43. #define FOR(i,a,b) for(int i=a;i<=b;i++)
  44. #define REP(i,n) for(int i=0;i<n;i++)
  45. #define REV(i,a,b) for(int i=a;i>=b;i--)
  46. #define test int T;si(T);FOR(Test,1,T)
  47. #define MEM(a,v) memset(a,v,sizeof(a))
  48. #define MAX(x,y) (x)>(y)?(x):(y)
  49. #define MIN(x,y) (x)<(y)?(x):(y)
  50. #define pb push_back
  51. #define pob pop_back
  52. #define b() begin()
  53. #define e() end()
  54. #define s() size()
  55. #define cl() clear()
  56. #define mp make_pair
  57. #define fi first
  58. #define se second
  59. #define All(X) X.b(),X.e()
  60. #define ub upper_bound
  61. #define lb lower_bound
  62. #define LL long long
  63. #define LD long double
  64. #define P_Q priority_queue
  65. #define PI pair< int,int >
  66. #define TRI pair< int,PI >
  67. #define TR_I pair< PI,int >
  68. #define VI vector< int >
  69. #define VP vector< PI >
  70. #define VT vector< TRI >
  71. #define MI map< int,int >
  72. #define MP map< PI,int >
  73. #define MS map< string,int >
  74. #define INF (1000000000)
  75. #define SZ 100000
  76. #define MOD (1<<30)
  77. #define PI 3.14159265
  78. #define TEST int Test;scanf("%d",&Test);while(Test--)
  79. #define mat_mul(c,a,b,n,mod){long long temp[10][10],k;for(int i=0;i<n;i++)for(int j=0;j<n;j++)for(k=temp[i][j]=0;k<n;k++)temp[i][j]=(temp[i][j]+a[i][k]*b[k][j])%mod;for(int i=0;i<n;i++) for(int j=0;j<n;j++)c[i][j]=temp[i][j];}
  80. /*********************************************************/
  81.  
  82. long double a[100009];
  83.  
  84. void solve()
  85. {
  86. int n;
  87. cin>>n;
  88. FOR(i,0,n-1)
  89. {
  90. long double x,y;
  91. cin>>x>>y;
  92. a[i]=atan2(y,x)* (long double)180 / (long double)PI;
  93. }
  94.  
  95. sort(a,a+n);
  96.  
  97. int j=-1,k=-1;
  98. FOR(i,0,n-1)
  99. if(a[i]>180.0)
  100. {
  101. j=i;
  102. break;
  103.  
  104. }
  105.  
  106. if(j==-1 || j==0)
  107. printf("%Lf\n",a[n-1]-a[0]);
  108. else
  109.  
  110. {
  111. long double ans=min(a[n-1]-a[0],a[j-1]+360.0-a[j]);
  112. printf("%Lf\n",ans);
  113. }
  114. }
  115.  
  116. int main()
  117. {
  118. //freopen ("input.txt","r",stdin);
  119. //freopen ("output.txt","w",stdout);
  120.  
  121. //TEST
  122. {
  123. solve();
  124. }
  125.  
  126. return 0;
  127. }
  128.  
  129.  
  130.  
Success #stdin #stdout 0.01s 3988KB
stdin
2
2 0
0 2
stdout
90.000000