/// Gheorghies Alexandru #include using namespace std; typedef long long ll; typedef pair pll; const ll NMAX=1e5+5; ll primes[NMAX],divisors[NMAX],cntp=0,cntdiv=0; bool sieve[NMAX]; void AddDivisors(ll base, ll exponent){ ll n=cntdiv,curr=1; for(ll j=1;j<=exponent;j++){ curr*=base; for(ll i=0;i cache; void tc(){ ll n,cpy; cin>>n; if(cache.count(n)){ cout<cpy){ ans=min(ans,divisors[i]); } } cache[cpy]=ans-cpy; cout<>t; while(t--) tc(); return 0; }