矩阵树+生成树计数+高精度
轮状病毒
https://darkbzoj.tk/problem/1002
Python特性非常奇怪
但是因为,高精度还是用Python写了
maxn = 102
D = [[0 for i in range(maxn)] for j in range(maxn)]
A = [[0 for i in range(maxn)] for j in range(maxn)]
mat = [[0 for i in range(maxn)] for j in range(maxn)]
def add(x, y):
global D, A
A[x][y] += 1
A[y][x] += 1
D[x][x] += 1
D[y][y] += 1
return
def swap(a, b):
return b, a
if __name__ == '__main__':
n = input()
n = int(n)
center = n
for now in range(0, int(n)):
add(now, center)
add(now, (now + 1) % n)
for i in