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 <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int N;
double dp[501][501];

double recursive(int num_of_rest_type,int know_num){
	if(dp[num_of_rest_type][know_num] != -1.0)return dp[num_of_rest_type][know_num];

	if(num_of_rest_type == know_num)return 0.0;

	double ret = 0.0;
	int num_cards = 2*num_of_rest_type-know_num;

	if(know_num > 0){
		ret += (double)know_num/(double)num_cards*(recursive(num_of_rest_type-1,know_num-1));
	}

	double new_p = (double)(num_cards-know_num)/(double)(num_cards);
	ret += new_p*(1.0/(double)(num_cards-1))*recursive(num_of_rest_type-1,know_num);
	ret += new_p*(double(know_num)/(double)(num_cards-1))*(1.0+recursive(num_of_rest_type-1,know_num));
	if((num_cards-1-(know_num+1) > 0)){
		ret += new_p*((double)(num_cards-1-(know_num+1))/(num_cards-1))*(1.0+recursive(num_of_rest_type,know_num+2));
	}
	return dp[num_of_rest_type][know_num] = ret;
}

void func(){

	for(int i = 0; i <= N/2; i++){
		for(int k = 0; k <= N/2; k++)dp[i][k] = -1.0;
	}

	printf("%.10lf\n",recursive(N/2,0));
}


int main(){

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		func();
	}

	return 0;
}