#include #define pt(sth) cout << sth << "\n" #define chmax(a, b) {if(ab) a=b;} #define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD using namespace std; typedef long long ll; typedef pair P; static const ll INF=1e18; static const ll MAX=101010; static const ll MOD=1e9+7; map prime[MAX*10*2]; void factrization(ll n) { ll id=n; for(ll i=2; i*i<=n; i++) { while(n%i==0) { prime[id][i]++; n/=i; } } if(n>1) prime[id][n]++; } int main(void) { ll X; cin >> X; ll i; for(i=1; i> v; for(i=1; isecond+1; } ll db=1; for(auto it=prime[B].begin(); it!=prime[B].end(); it++) { db*=it->second+1; } ll fa=A-da; ll fb=B-db; v.push_back({abs(fa-fb), {A, B}}); } sort(v.begin(), v.end()); ll t=v[0].first; for(i=0; i