intmerge(int x,int y) { if (x!=y){ int mid=(x+y)/2; merge(x,mid); merge(mid+1,y); memset(f,0,sizeof(f)); int i=x,k=x; int j=mid+1; while (i<=mid&&j<=y){ if (tu[i].y*tu[j].x<tu[i].x*tu[j].y){ f[k]=tu[i]; i+=1; } else { f[k]=tu[j]; j+=1; } k+=1; } while (i<=mid){ f[k]=tu[i]; i+=1; k+=1; } while (j<=y){ f[k]=tu[j]; j+=1; k+=1; } for (int i=x;i<=y;i++) tu[i]=f[i]; } }
intmain(){ scanf("%ld",&n); for (int i=1;i<=n;i++) scanf("%ld%ld",&x[i],&y[i]); sum=0; for (int i=1;i<=n;i++){ for (int j=1;j<=n;j++){ tu[j].x=x[j]-x[i]; tu[j].y=y[j]-y[i]; tu[j].cover=0; if (i==j){ tu[j].x=tu[1].x; tu[j].y=tu[1].y; tu[j].cover=tu[1].cover; } else while (!((tu[j].x>0)&&(tu[j].y>=0))) rt90(j); } merge(2,n); int j=2; while (j<=n){ memset(ans,0,sizeof(ans)); int k=j; while ((k<=n)&&(tu[j].y*tu[k].x==tu[j].x*tu[k].y)){ ans[tu[k].cover]+=1; k+=1; } j=k; for (int o=0;o<=3;o++) sum+=ans[o]*ans[(o+1)%4]; } } printf("%ld",sum); }