Compute how many squares on average does a queen attack on a generalized chess board n × n.
The queen attacks a square if it is on the same row, column or diagonal. For example, the queen denoted by the letter Q in the image bellow attacks 17 squares marked with dots:
The first line contains positive integer n (1 ≤ n ≤ 10^6
), the number of lines and columns of a board.
The output consists of one real number rounded to exactly three decimal places, the average number of fields attacked by a queen.