#include #include #include #define N 1000 using namespace std; int memo[N][N]; int gcd(int x,int y){ if(!y)return x; if(x >v(n); for(int i=0;i