#include using namespace std; #define rep(i,a,b) for(int i=a;i> N; ll ans = N; rep(i, 2, sqrt(N)+1) { if (N % (ll)i == 0) { if (i == 2) ans = min(ans, N / (ll)i); else ans = min(ans, (ll)i); } } cout << ans << endl; }