#include <cstdio> using namespace std; int main() { int n; while(EOF != scanf("%d", &n)) { if(n < 3){ printf("-1\n"); }else if(n%2 == 1){ printf("2\n"); }else{ if ((n/2) * (n-1) % 2 == 0){ printf("3\n"); } else{ printf("4\n"); } } } return 0; }
#include <cstdio> using namespace std; int main() { int n; while(EOF != scanf("%d", &n)) { if(n < 3){ printf("-1\n"); }else if(n%2 == 1){ printf("2\n"); }else{ if ((n/2) * (n-1) % 2 == 0){ printf("3\n"); } else{ printf("4\n"); } } } return 0; }