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# (Mono 4.6.2.0) (judge verdict: Accepted)

using System;
 
public class Program
{
 
    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        if (n % 2 == 0)
        {
            Console.WriteLine("0.5");
        }
        else
        {
            double even = (double) (n / 2) / n;
            Console.WriteLine((double)1-even);
        }
    }
 
    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}
 
class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }
 
    const char Separator = ' ';
    private int _pos;
    private string[] _line;
 
    #region スペース区切りで取得
 
    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }
 
        return _line[_pos++];
    }
 
    public int NextInt()
    {
        return int.Parse(Next());
    }
 
    public long NextLong()
    {
        return long.Parse(Next());
    }
 
    public double NextDouble()
    {
        return double.Parse(Next());
    }
 
    #endregion
 
    #region 型変換
 
    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }
 
        return result;
    }
 
    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }
 
        return result;
    }
 
    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }
 
        return result;
    }
 
    #endregion
 
    #region 配列取得
 
    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);
 
        _pos = _line.Length;
        return _line;
    }
 
    public int[] IntArray()
    {
        return ToIntArray(Array());
    }
 
    public long[] LongArray()
    {
        return ToLongArray(Array());
    }
 
    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }
 
    #endregion
}