1 #include <iostream> 2 3 using namespace std; 4 #define ll long long 5 6 ll get_max_prime(ll n){ 7 ll cmp = 0; 8 for(ll i = 2; i <= n; i++){ 9 while(n % i == 0){ 10 n /= i; 11 cmp = i; 12 } 13 } 14 if(n > 1 && n > cmp) 15 cmp = n; 16 return cmp; 17 } 18 int main() 19 { 20 ll n; 21 while(cin >> n){ 22 cout << get_max_prime(n) << endl; 23 } 24 return 0; 25 }