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 Fortran (gfortran v4.8.4) (judge verdict: Runtime Error)

program main
    implicit none
    integer(8),pointer:: an(:),bn(:)
    integer(kind=8):: a,b,i,j,ans
    read*, a,b
    ! print*, a,b
    allocate(an(1),bn(1))
    call calc_pn(a,an)
    call calc_pn(b,bn)
    ! print*, an
    ! print*, bn
    j=1
    ans = 1
    do i =1,size(an)
        if (an(i) == 0)cycle
        if (j > size(bn)) exit
        do while(bn(j) < an(i))
            j = j + 1
        end do
        if (bn(j) == an(i)) ans=ans+1
    end do

    print*, ans

contains
subroutine calc_pn(num,pn_list)
    integer(8), pointer:: pn_list(:)
    integer(8):: num
    integer(8):: p,i
    p = 0
    do i = 2, int(sqrt(real(num)))+10
        if (mod(num,i)/=0) cycle
        p = p + 1
        if (p > size(pn_list)) call append(pn_list)
        pn_list(p) = i
        do while(mod(num,i) == 0)
            num= num/i
        end do
    end do
    if (num == 1)return
    p = p + 1
    if (p > size(pn_list)) call append(pn_list)
    pn_list(p) = int(num)
end subroutine 


subroutine append(arr) 
    integer(8), pointer:: arr(:)
    integer(8), pointer:: tmp(:)
    integer(8):: size_
    size_ = size(arr)
    allocate(tmp(size_))
    tmp(1:size_) = arr(1:size_)
    deallocate(arr)
    allocate(arr(2*size_))
    arr(1:size_) = tmp(1:size_)
    arr(size_+1:2*size_) = 0
    deallocate(tmp)
    return
end subroutine


end program