Problem: Memory match is a single-player game which employs a set of 2M cards. Each card is labeled with a number between 1 and M on its face. For each number i (1 ≤ i ≤ M), there are exactly two cards which have the number i. At the start of the game, all cards are shuffled and laid face down on a table. In each turn you choose two cards and turn them face up. If two numbers on the cards are the same, they are removed from the table. Otherwise, they are turned face down again (this is called a mismatch). When you choose cards, you do not have to turn two cards simultaneously; you can choose the second card after you see the number of the first card. The objective of the game is to remove all the cards with as few mismatches as possible.

Royce A. Mitchell has extraordinary memory, so he can remember all the positions and the numbers of the cards that he has already turned face up. Your task is to write a program that calculates the expected number of mismatches, on average, when he plays the game optimally.



Input

The input consists of multiple datasets.

Each dataset consists of one even number N (2 ≤ N ≤ 1000) which denotes the number of cards in the set.

The end of input is indicated by a line that contains a single zero. This is not part of the input and you may not treat this line as a dataset.

Output

For each dataset, print the expected number of mismatches. Each output value may have an arbitrary number of fractional digits, provided that the error is within 10-6.

Example

Input

2
4
6
8
10
52
0


Output

0.0000000000
0.6666666667
1.3333333333
1.9238095238
2.5523809524
15.4435236099

Solution (in CPP):

Solution:
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        vector<vector<double> > p(n+1, vector<double>(n+2, 0.0));
        p[n][0] = 1.0;
        double ret = 0.0;

        for(int a=n; a>0; a-=2){       // 残りのカード枚数
            for(int b=0; b<=a/2; ++b){ // 位置が分かっているカードの枚数
                // 位置が分かっているカードのもう一方のカードを1枚目で引く
                double p1 = 0.0;
                if(b > 0){
                    p1 = (double)b / (a - b);
                    p[a-2][b-1] += p[a][b] * p1;
                }
                
                // 位置が分かっているカードのもう一方のカードを2枚目で引く
                double p2 = 0.0;
                if(a - b - 1 > 0){
                    p2 = (1.0 - p1) * b / (a - b - 1);
                    p[a-2][b] += p[a][b] * p2;
                    ret += p[a][b] * p2;
                }

                // 1枚目と2枚目が同じ
                double p3 = 0.0;
                if(a - b - 1 > 0){
                    p3 = (1.0 - p1) / (a - b - 1);
                    p[a-2][b] += p[a][b] * p3;
                }

                // ミス
                double p4 = 1.0 - p1 - p2 - p3;
                p[a][b+2] += p[a][b] * p4;
                ret += p[a][b] * p4;
            }
        }

        printf("%.10f\n", ret);
    }
}