human
I found an interesting problem on https://www.codechef.com/DEC11/problems/HYPER:
A hypergraph is a generalization of a graph, where an edge can connect any number of vertices. A k-uniform 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 3-uniform hypertrees on N vertices. Two 3-uniform 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 263-1.

-----Examples-----
Input:
4
3
4
5
8

Output:
1
6
25
93268

Explanation:
There is just one 3-uniform 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)}.

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is Python code to find the number of 3-uniform hypertrees on N vertices.

"""
#this code is a precomputation part.
#it takes about 2 hours.
class Graph:
  def __init__(self,n):
    self.edge=[[0 for j in xrange(n)] for i in xrange(n)]
    self.n=n

  def addedge(self,i,j,m=1):
    assert i!=j and 0<=i<self.n and 0<=j<self.n
    self.edge[i][j]+=m
    self.edge[j][i]+=m

  def deledge(self,i,j,m=1):
    assert i!=j and 0<=i<self.n and 0<=j<self.n
    self.edge[i][j]-=m
    self.edge[j][i]-=m

  def strongconnect(self):
    ret = True
    n=self.n
    for i in xrange(n):
      for j in xrange(i+1,n):
        if self.edge[i][j]:
          self.deledge(i,j)
          ret=self.connect()
          self.addedge(i,j)
          if ret==False:return ret
    return True

  def connect(self):
    n=self.n
    edge=self.edge
    z=[0 for _ in xrange(n)]
    def f(i):
      assert 0<=i<n
      if z[i]==1:return
      z[i]=1
      for j in xrange(n):
        if edge[i][j]:f(j)
    f(0)
    return sum(z)==n

  def Nconnect(self):
    n=self.n
    edge=self.edge
    z=[0 for _ in xrange(n)]
    def f(i):
      assert 0<=i<n
      if z[i]==1:return
      z[i]=1
      for j in xrange(n):
        if edge[i][j]:f(j)
    ret=0
    for ver in xrange(n):
      if z[ver]==0:
        ret+=1
        f(ver)
    return ret

def search(nv,ne):
  graph=Graph(nv)
  init=( graph, (0,0), ne)
  def f(state):
    ret=0
    g,(i,j),e=state
    if e==0:
      if g.strongconnect():
        return fact(ne)
      else:return 0

    if e<g.Nconnect():
      return 0
    for i2 in xrange(nv):
      for j2 in xrange(i2+1,nv):
        if (i2,j2)>(i,j):
          for k in xrange(1,e+1):
            g.addedge(i2,j2,k)
            ret += f((g,(i2,j2),e-k)) / fact(k)
            g.deledge(i2,j2,k)
    return ret
  return f(init)

def fact(n):
  assert n>=0
  ret=1
  for i in xrange(n):ret*=i+1
  return ret

def comb(a,b):
  return fact(a+b)/fact(a)/fact(b)
  pass

nnn=17
sve=dict( ( (v,e),search(v,e) )  for v in xrange(nnn+1) for e in xrange(nnn+1) if e>=v and e+v<=nnn)
sve[(1,0)]=1
print sve
"""

output="""
{(6, 9):...