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>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

// dp[i][j] := ( i 組のカードがあり、そのうち j 種類の(片方の)場所がわかっている状態でのミスマッチ回数の期待値 )
double dp[501][501];
double dfs(int i,int j){
	if(i==0) return 0;

	if(dp[i][j]!=-1) return dp[i][j];

	// 一枚目を、まだ中身がわかっていない 2*i-j 枚の中から選ぶ
	// 確率 p=j/(2*i-j) で場所が知れているカードと同じ絵柄を引き当てる
	// このとき、二枚目を引いて確実に絵柄を揃えられる
	double res1=0;
	if(j>0) res1+=dfs(i-1,j-1);

	// 確率 1-p で場所が知れていないカードを引き当てる
	// 二枚目を引いたとき
	// - 一枚目と同じ絵柄だった
	// - すでに場所が知れているカードと同じ絵柄だった
	// - まだ場所が知れていないカードだった
	// の三通りが起こりうる
	double res2=0;
	if(i>j){
		res2+=1.0/(2*i-j-1)*dfs(i-1,j);
		if(j> 0 ) res2+=1.0*j/(2*i-j-1)*(dfs(i-1,j)+1);
		if(i>j+1) res2+=1.0*(2*i-2*j-2)/(2*i-j-1)*(dfs(i,j+2)+1);
	}

	double p=1.0*j/(2*i-j);
	return dp[i][j]=p*res1+(1-p)*res2;
}

int main(){
	rep(i,501) rep(j,501) dp[i][j]=-1;
	for(int n;scanf("%d",&n),n;) printf("%.9f\n",dfs(n/2,0));
	return 0;
}