#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
double memo[501][501];
// N - カードの種類, M - 公開カードの種類
double solve(int N, int M){
  assert(N >= M);
  assert(M >= 0);
  double& res = memo[N][M];
  if(res != -1) return res;
  if(N == M) return 0;
  res = 0;
  int ALL = 2 * N - M;
  if(M > 0) res += (double)M / ALL * solve(N - 1, M - 1);
  res += (double)(ALL - M) * 1 / (ALL * (ALL - 1)) * solve(N - 1, M);
  res += (double)(ALL - M) * M / (ALL * (ALL - 1)) * (1.0 + solve(N - 1, M));
  if(N - M > 1) res += (double)(ALL - M) * (ALL - 1 - M - 1) / (ALL * (ALL - 1)) * (1.0 + solve(N, M + 2));
  return res;
}
int main(){
  int N;
  REP(i, 501)REP(j, 501) memo[i][j] = -1;
  while(cin >> N && N){
    printf("%.15lf\n", solve(N / 2, 0));
  }
  return 0;
}
### Prompt

Construct a Cpp code solution to the problem outlined:

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

### Response

```cpp
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
double memo[501][501];
// N - カードの種類, M - 公開カードの種類
double solve(int N, int M){
  assert(N >= M);
  assert(M >= 0);
  double& res = memo[N][M];
  if(res != -1) return res;
  if(N == M) return 0;
  res = 0;
  int ALL = 2 * N - M;
  if(M > 0) res += (double)M / ALL * solve(N - 1, M - 1);
  res += (double)(ALL - M) * 1 / (ALL * (ALL - 1)) * solve(N - 1, M);
  res += (double)(ALL - M) * M / (ALL * (ALL - 1)) * (1.0 + solve(N - 1, M));
  if(N - M > 1) res += (double)(ALL - M) * (ALL - 1 - M - 1) / (ALL * (ALL - 1)) * (1.0 + solve(N, M + 2));
  return res;
}
int main(){
  int N;
  REP(i, 501)REP(j, 501) memo[i][j] = -1;
  while(cin >> N && N){
    printf("%.15lf\n", solve(N / 2, 0));
  }
  return 0;
}
```