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 <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

double memo[1010][1010];
int n;
double solve(int now, int rest) { // rest : 開けたけど残っているもの
  //cout << now << " " << rest << endl;
  if (now >= n) return 0;
  //assert(now != n-1);
  if (memo[now][rest] >= 0) return memo[now][rest];
  int num = rest+1;
  double res = 0;
  double p = (double)rest/(n-now);
  if (rest) {
    res += solve(now+1, rest-1) * p; // 既に開けた奴とマッチ
  }
  // 1枚目が初めて
  p = 1-p;
  if (rest != n-now) {
    // 2枚目が既に開けたやつ
    double q = (double)rest/(n-now-1);
    if (rest) {
      res += (1 + solve(now+2, rest)) * p * q;
    }
    // 2枚目も初めて
    q = double(n-now-1-rest-1)/(n-now-1);
    if (n-now-1-rest-1) {
      res += (1 + solve(now+2, rest+2)) * p * q;
    }
    // 2枚目が同じ
    q = 1.0/(n-now-1);
    res += solve(now+2, rest) * p * q;
  }
  //cout << now << " " << rest << " " << res << endl;
  return memo[now][rest] = res;
}

int main() {
  while(cin>>n,n) {
    REP(i,n)REP(j,n) memo[i][j] = -1;
    
    printf("%.10f\n", solve(0,0));
  }
}