HyperGraph

0

0 votes
Medium-Hard
Problem

Study Hypergraph

Calling 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).

CONSTRAINTS

1T15

3N17

INPUT

The first line of the input contains an integer T. Then T lines follow, each contains an integer N .

OUTPUT

For each test case output one line containing the requested number.

Time Limit: 1
Memory Limit: 256
Source Limit:
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)}.

Editor Image

?