#include using namespace std; #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const int mod=1000000007; const int INF=1001001001; int f(int P,int Q){ vectorA; for(int i=3;i*i<=P;i++){ int s=P/i; if(P%i==0){if(Q%(i-2)==0&& s > Q/(i-2)){A.push_back(i-1);} if(i!=s&&Q%(s-2)==0&&P/s>Q/(s-2)){A.push_back(P/i-1);} } } int n=A.size(); int cnt=0; for(int i=0;i>N; vectorx(N),y(N); for(int i=0;i>x[i]>>y[i]; } int cnt=0; for(int i=0;i