/** * Polygonal Line Search (PKU 2684) * by Kenji Inoue, 2006-12-29 **/ #include using namespace std; struct lines { int m; int len[10]; int dir[10]; // right = 1, straight = 0, left = -1 }; int main() { int n; int x, y, d, px, py, pd; lines L[51]; while (cin >> n, n) { for (int i=0; i<=n; i++) { cin >> L[i].m; for (int j=0; j> x >> y; if (j == 0) { } else { d = (x == px ? y-py : x-px); L[i].len[j-1] = abs(d); if (j == 1) { L[i].dir[j-1] = 0; } else { if (x == px) { L[i].dir[j-1] = ( pd * d > 0 ? 1 : -1 ); } else { L[i].dir[j-1] = ( pd * d > 0 ? -1 : 1 ); } } } px = x; py = y; pd = d; } L[i].m--; L[i].dir[L[i].m] = 0; } for (int i=1; i<=n; i++) { if (L[0].m != L[i].m) { continue; } // standard order bool same = true; for (int j=0; j