哈哈,只有我一個人做出來,下面說下怎么做。

Illustration 1: 4-circle five-angle graph
首先,中間的環肯定要去掉一些,但是去掉多少條、哪幾條呢?可以枚舉情況。就拿樣例說,我們去掉任意的兩條,得到下圖:

紅色的邊表示去掉的。
1)對于非紅色邊組成的環,4條邊任意一條都能刪除,即4n-i 這里i是中間環要刪除的邊數
2)對于紅色邊組成的環,這4*i條邊只能刪除一條,刪多了就會不連通了,也即4*i種
再乘上一個組合數C(n,i)即可
所以F(n) = ∑ 4n-i*4*i*C(n,i) 1≤i≤n
樣例給了2,注意是2條平行邊形成的環!





















































附題目:
Problem A. Spanning Tree
A peculiar graph, called n-circle five-angle graph, consists of a polygon with n vertices in the center, and each side of the central polygon is linked with a pentagon(pentagon: a polygon with 5 sides). There is an example of 4-circle five-angle graph below. Obviously, there are 4 vertices in the central polygon.
Now, it is you time to calculate how many spanning trees could this special graph generate. Pay attention that all the vertices in the graph should be regarded as different ones. Do you still remember the definition of spanning tree? Perhaps you may be familiar with the terminology of MST(minimal spanning tree). Yes, a spanning tree T of a connected, undirected graph G is a tree composed of all the vertices and some (or perhaps all) of the edges of G.
Illustration 1: 4-circle five-angle graph
Input:
First line: T, the number of test case.
Then follow T lines, each line contains a number n(n <= 2 <= 100), indicating it is an n-circle five-angle graph.
Output:
For each test case, output the answer mod 2007 pre line.
Sample Input
1
2
Sample Output
40
哎呀。。我暴露了~~哈哈