Problem 4886. -- Poj1737 Connected Graph

4886: Poj1737 Connected Graph

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 4  Solved: 4
[Submit][Status][Web Board]

Description

求N个节点的无向连通图有多少个,节点有标号,编号为1~N,1≤N≤50。
注:节点有标号,意味着下列三种是不同的连通图,都应该算作一次计数。

Input

The input contains several test cases. 
Each test case contains an integer n, denoting the number of vertices. 
You may assume that 1<=n<=50. The last test case is followed by one zero.

Output

For each test case output the answer on a single line.

Sample Input

1
2
3
4
0

Sample Output

1
1
4
38

HINT

Source

[Submit][Status]