#include #include #include #include using namespace std; /*struct par { int x; int y; }*/ typedef vector > > vp; vp iv(11); vector > hatv(11); void makeiv() { for (int i=2; i<11; ++i) { int x(0), y(0), z; iv[i].push_back(make_pair(x, y)); hatv[i].push_back(1); hatv[i].push_back(1); while (x>=-1000000 || y<=1000000) { z=y*(-i); y=x*(-i)+(i-1); x=z; iv[i].push_back(make_pair(x, y)); hatv[i].push_back(hatv[i][hatv[i].size()-1]*(-i)); } /* for (int j=0; jn || iv[b][i].second0; --j) { int k; for (k=0; iv[b][j-1].first>n || iv[b][j-1].second