#include #include using namespace std; using vi=vector; using vvi=vector >; struct count_t { int win, lose; }; int count(vvi& s) { int n=s.size(); vi c(n); int rank=0; int b[n]={0}; for(int y=0;y=0;i--) { if(b[i]) rank++; if(c[0]==i) return rank; } return 999; } int min_u(int& m, int v) { if(m>v) { m=v; return 1; } return 0; } void vvi_dump(const vvi& s) { unsigned x, y; for(y=0;y c; int n; int x, y; while(scanf("%d", &n)==1) { c.resize(n); s.resize(n); for(y=0;y