#include #include // (2^3)^14 < 10^14 < (2^4)^14 long long P[4*14]; int E[4*14]; int Pend = 0; int factor(long long N) { long long p; int e; p=2; if (N%p == 0) { P[Pend] = p; e=1; for (N/=p; N%p==0; N/=p) e++; E[Pend] = e; Pend++; } for (p=3; p*p<=N; p+=2) { if (N%p == 0) { P[Pend] = p; e=1; for (N/=p; N%p==0; N/=p) e++; E[Pend] = e; Pend++; } } if (N != 1) { P[Pend] = N; E[Pend] = 1; Pend++; } return 0; } long long pwr(long long d, int e) { long long dd = 1; if (e == 0) { } else { int i; for (i=1; i<=e; i++) dd*=d; } return dd; } int cmpr(const void *a, const void *b) { if (*(long long *)a < *(long long *)b) { return -1; } else if (*(long long *)a > *(long long *)b) { return 1; } else { return 0; } } int main() { long long N; scanf("%lld", &N); factor(N); int i; long long *D; int Dsz = 1; for (i=0; i (a+b+c-3)) min = a+b+c-3; } j++; } i++; } printf("%lld %lld\n", min, N-1); return 0; }