#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- ll N,X; vector V; unordered_map R; map memo[101][1500]; ll dfs(int left,int id,ll v) { if(left==0) return v==X; if(memo[left][id].count(v)) return memo[left][id][v]; ll ret=0; int x; for(x=id;x enumdiv(ll n) { vector S; for(ll i=1;i*i<=n;i++) if(n%i==0) {S.push_back(i); if(i*i!=n) S.push_back(n/i); } sort(S.begin(),S.end()); return S; } void solve() { int i,j,k,l,r,x,y; string s; cin>>N>>X; X++; V=enumdiv(X); FOR(i,V.size()) R[V[i]]=i; cout<