Sponsors

Tag: problem: (D) Taxes Solve in C/C++

Codeforces Round #382 (Div....

#include<stdio.h> int isprime(int n); int main(){ int n; scanf("%d",&n); if(n%2==1){ if(isprime(n)){ printf("1"); }else{ printf("%d",3-isprime(n-2)); } }else{ printf("%d",1+(n>2)); } return 0; } int isprime(int n){ int i,j; for(i=2;i*i<=n;i++){ if(n%i==0){ return...

Advertisement

spot_img