document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <bits/stdc++.h>
  2. #define REP(I, N) for (int I = 0; I < (N); ++I)
  3. #define REPP(I, A, B) for (int I = (A); I < (B); ++I)
  4. #define PII pair<int,int>
  5. #define F first
  6. #define S second
  7. #define MP make_pair
  8. typedef long long LL;
  9. using namespace std;
  10. const int SIZE = 2e6+10;
  11. int x[SIZE],y[SIZE];
  12. LL sqr(LL x){return x*x;}
  13. PII pp[SIZE];
  14. int pn;
  15. int main(){
  16.     int N;scanf("%d",&N);
  17.     REP(i,N)scanf("%d%d",&x[i],&y[i]);
  18.     REP(i,N)REPP(j,i+1,N){
  19.         if(sqr(x[i])+sqr(y[i])==sqr(x[j])+sqr(y[j])){ //兩個點只有在與原點距離相同時才有可能配對
  20.            
  21.             /* 兩個點的對稱軸可藉由把兩個點視為向量相加得到
  22.              * 並把得到的向量轉到第一第二象限,並除以x,y座標最大公因數
  23.              * 要注意兩向量和為零時為special case
  24.              */
  25.             int dx=x[i]+x[j];
  26.             int dy=y[i]+y[j];
  27.  
  28.             if(!dx&&!dy){ //兩向量和為零時,把其中一個向量旋轉九十度就是對稱軸
  29.                 dx=y[i];
  30.                 dy=-x[i];
  31.             }
  32.             if(!dx)pp[pn++]=MP(0,1);
  33.             else if(!dy)pp[pn++]=MP(1,0);
  34.             else{
  35.                 int gg=__gcd(abs(dx),abs(dy));
  36.                 dx/=gg;
  37.                 dy/=gg;
  38.                 if(dy<0){
  39.                     dx=-dx;
  40.                     dy=-dy;
  41.                 }
  42.                 pp[pn++]=MP(dx,dy);
  43.             }
  44.         }
  45.     }
  46.     sort(pp,pp+pn);
  47.     int ma=0;
  48.     long double an=acos(-1);
  49.     for(int i=0,j;i<pn;i=j){
  50.         for(j=i+1;j<pn&&pp[i]==pp[j];j++);
  51.         int cnt=j-i;
  52.         if(cnt>ma||(cnt==ma&&atan2(pp[i].S,pp[i].F)>an)){
  53.             ma=cnt;
  54.             an=atan2(pp[i].S,pp[i].F);
  55.         }
  56.     }
  57.     printf("%.3f\\n%d\\n",(double)(an*180/acos(-1)),N-2*ma);
  58.     return 0;
  59. }
');