Problem:
Score : 100 points

Problem Statement

Given is an integer N.

Takahashi chooses an integer a from the positive integers not greater than N with equal probability.

Find the probability that a is odd.

Constraints

1 \leq N \leq 100

Input

Input is given from Standard Input in the following format:

N

Output

Print the probability that a is odd.
Your output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.

Sample Input 1

4

Sample Output 1

0.5000000000

There are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \frac{2}{4} = 0.5.

Sample Input 2

5

Sample Output 2

0.6000000000

Sample Input 3

1

Sample Output 3

1.0000000000

Solution in C (Clang 3.8.0) (judge verdict: Runtime Error)

int main(){
    int a,b,count=0,result=0;
    int check =1;
    scanf("%d %d",&a,&b);
    int p[1000000000];
    //素数判定
    for (int i=1;i<=((a<b)?a:b);i++){
        //printf("count:%d\n",count);
//iが素数かしらべる
    for (int j=1;j<count;j++){
        //iが素数か調べるために、既知の素数列pを用いる
        //printf("i:%d p[%d]:%d\n",i,j,p[j]);
        if(i%p[j]==0){
           // printf("%dは素数でない\n",i);
          check=0;
            break;//iは素数でない//下の処理を飛ばしiを増やす
        }
        check=1;
        }
    
    if (check==1){
        //以下は素数を追加する処理
        //printf("%dを%d番目の素数として認める\n",i,count+1);
        p[count]=i;
        // for(int k=0;k<=count;k++){
        //     printf("%d番目の素数は %d\n",k+1,p[k]);    
        // }        
        count++;
        check =1;
        //ここまで素数追加
        
        if (a%i==0&&b%i==0){
            //printf("c\n");
           // printf("素数%dは%d,%dをともにわれます\n",i,a,b);
            result++;
        }
    }
}
    printf("%d",result);
    return 0;
}