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