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 <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <fstream>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b))<EPS)

int m;
double dp[1001][1001];

//ifstream ifs("input.txt");
//#define cin ifs

double dfs(int pos,int mem){
	if(mem<0)return 0;
	else if(pos<0)return 0;
	else if(pos+1<=mem)return 0;
	else if(dp[pos][mem]>=-0.5)return dp[pos][mem];
	double res=0;
	double per1=1.0*mem/(pos+1);
	// êÚªÌÉ¶Ý
	if(!EQ(per1,0))
		res+=per1*(dfs(pos-1,mem-1));
	if(!EQ(per1,1)){
		double per2=(1.0)/(pos);
		// êÚÈOÆ}b`
		double per3=((double)mem)/(pos);
		// êÚÆ}b`
		if(!EQ(per2,0))
			res+=(1-per1)*(per2*(dfs(pos-2,mem)));
		// êÚÈOÌÌàÌÆ}b`
		if(!EQ(per3,0))
			res+=(1-per1)*(per3*(dfs(pos-2,mem)+1));
		// }b`¹¸
		if(!EQ(1-per2-per3,0))
			res+=(1-per1)*(1-per2-per3)*(dfs(pos-2,mem+2)+1);
	}
	return dp[pos][mem]=res;
}

int main(){

	for(int i=0;i<1001;i++)
		for(int j=0;j<1001;j++)dp[i][j]=-1;
	while(cin>>m&&m!=0){
		double res=dfs(m-1,0);
		printf("%.8f\n",res);
	}

	return 0;
}