func_code_string: #include <bits/stdc++.h>   using namespace std;   long long prime[500001];   bool vis[500001];   bool isPrime(long long x) {     for (long long i = 2; i <= sqrt(x); i++) {       if (x % i == 0) return false;     }     return true;   }   int main() {     long long n;     int cnt = 0;     memset(vis, false, sizeof(vis));     memset(prime, 0, sizeof(prime));     for (int i = 2; i <= 110000; i++) {       if (!vis[i]) prime[cnt++] = i;       for (int j = 0; j < cnt && i * prime[j] <= 110000; j++) {         vis[i * prime[j]] = true;         if (i % prime[j] == 0) break;       }     }     while (~scanf( %lld , &n)) {       if (isPrime(n)) {         printf( 1 n );       } else {         for (int i = 0; i < cnt; i++) {           if (n % prime[i] == 0) {             printf( %lld n , 1 + (n - prime[i]) / 2);             break;           }         }       }     }     return 0;   }   