Hypertrees

All submissions for this problem are available.
A hypergraph is a generalization of a graph, where an edge can connect any number of vertices. A kuniform hypergraph is a hypergraph such that all its hyperedges have size k. For more information, see Wikipedia.
Let's call a particular hypergraph a hypertree if it is connected (that is, you can move from any vertex to any other vertex using only its hyperedges) and removing any of its hyperedges makes the hypergraph disconnected (note that this definition of hypertrees differs from the standard one).
Given just one integer N, find the number of 3uniform hypertrees on N vertices. Two 3uniform hypertrees are considered different if a hyperedge (u, v, w) exists such that it is present in exactly one of these hypertrees (note that the order of vertices in the hyperedge doesn't matter, and neither does the order of hyperedges in the hypertree).
Input
The first line of the input contains an integer T  the number of test cases (at most 15). Then T lines follow, each contains an integer N (3 ≤ N ≤ 17).
Important! Please include all code used in solving this problem in your solution.
Output
For each test case output one line containing the requested number. It's guaranteed that this number won't exceed 2^{63}1.
Examples
Input: 4 3 4 5 8 Output: 1 6 25 93268 Explanation:
There is just one 3uniform hypertree on 3 vertices: {(1,2,3)}. There are six of them on 4 vertices: {(1,2,3), (1,2,4)}, {(1,2,3), (1,3,4)}, {(1,2,3), (2,3,4)}, {(1,2,4), (1,3,4)}, {(1,2,4), (2,3,4)}, {(1,3,4), (2,3,4)}. Two of the 25 possible hypertrees on 5 vertices are {(1,2,3), (3,4,5)} and {(1,2,3), (1,2,4), (1,2,5)}.
Author:  gennady.korotkevich 
Tester:  pieguy 
Editorial  http://discuss.codechef.com/problems/HYPER 
Tags  dec11, gennady.korotkevich, hard 
Date Added:  30092011 
Time Limit:  0.2 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 