int main(){ while(scanf("%d",&n)!=EOF){ if(!n) break; for(int i=1;i<=n;++i) scanf("%d",&a[i]); getsuffix(); work(); } return 0; }
int main(){ scanf("%d%d",&n,&K); for(int i=1;i<=n;++i){ scanf("%d",&a[i]); rank[i].a=a[i]; } getsuffix(); int l=0,r=n/2,m; while(l<=r){ m=l+r>>1; if(check(m)) l=m+1; else r=m-1; } while(l&&!check(l)) --l; printf("%d\n",l); return 0; }
void test(){ getsuffix("ethnic"); }
// read the tranditional infile for the distance matrix void Mdist::readmtx(const string& file){ if(getsuffix(file) == "nc") readmtxnc(file); else readmtxtxt(file); };