#include<bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const double PI = acos(-1);
const int maxn = 100010;
typedef struct{double x,y;} pos;
typedef struct{pos st,ed;} line;
inline int sign(double x){
if(fabs(x)<eps) return 0;
else if(x > eps) return 1;
else return -1;
}
inline int dcmp(double x,double y){
if(fabs(x-y)<eps) return 0;
else if(x > y) return 1;
else return -1;
}
pos operator +(pos a,pos b){return{a.x+b.x,a.y+b.y};}
pos operator -(pos a,pos b){return{a.x-b.x,a.y-b.y};}
pos operator *(pos a,double k){return {a.x*k,a.y*k};}
pos operator /(pos a,double k){return {a.x/k,a.y/k};}
double operator*(pos a,pos b){return a.x*b.y-a.y*b.x;}
double operator&(pos a,pos b){return a.x*b.x+a.y*b.y;}
pos pl[maxn];
int n,m,q[maxn];
line ln[maxn];
double get_angle(line a){
pos st = a.st,ed = a.ed;
return atan2(ed.y-st.y,ed.x-st.x);
}
inline double area(pos a ,pos b,pos c){
return (b - a) * (c - a);
}
inline bool cmp(line a,line b){
return get_angle(a) < get_angle(b);
}
pos line_intersection(pos p,pos v,pos q,pos w){
pos u = p - q;
double t = (w * u) / (v * w);
return {p.x+v.x*t,p.y+v.y*t};
}
pos line_intersection(line a,line b){
return line_intersection(a.st,a.ed-a.st,b.st,b.ed-b.st);
}
bool on_right(line& a,line& b,line& c){
pos o = line_intersection(b,c);
return sign(area(a.st,a.ed,o)) <= 0;
}
bool halfplaneintersection(int cnt){
sort(ln,ln+cnt,cmp);
int hh = 0,tt = 0;
// cout << cnt << endl;
for(int i = 0 ; i < cnt ; i ++){
if(!i&&!dcmp(get_angle(ln[i]),get_angle(ln[i-1]))) continue;
while(hh<tt&&on_right(ln[i],ln[q[tt-1]],ln[q[tt]])) tt -= 1;
while(hh<tt&&on_right(ln[i],ln[q[hh]],ln[q[hh+1]])) hh += 1;
q[++tt] = i;
}
//printf("mid = 1 :: %d %d\n",hh,tt);
while(hh<tt&&on_right(ln[hh],ln[q[tt-1]],ln[q[tt]])) tt -= 1;
while(hh<tt&&on_right(ln[tt],ln[q[hh]],ln[q[hh+1]])) hh += 1;
//q[++tt] = q[hh];
//printf("mid = 1 :: %d %d\n",hh,tt);
if(hh>=tt) return false;
else return true;
}
bool check(int mid){
int cnt = 0;
for(int i = 1 ; i <= n ; i ++){
int xx = i,yy = (i + mid) % n;
ln[cnt++] = (line){pl[yy],pl[xx]};
}
return halfplaneintersection(cnt);
}
int main(){
while(scanf("%d",&n)==1&&n){
memset(q,0,sizeof q);
for(int i = 1 ; i <= n ; i ++) scanf("%lf%lf",&pl[i].x,&pl[i].y);
int l = 1, r = n;
while(l<=r){
int mid = (l + r) >> 1;
//cout << mid << endl;
if(check(mid)) l = mid + 1; //如果半平面交非空
else r = mid - 1;
}
printf("%d\n",l);
}
return 0;
}
板子应该没问题,谁看下为啥T了 15秒限制,而且udebug没有数据。