2 shunfurh shunfurh 于 2017.08.28 22:21 提问

Hypercube

A N-dimension hypercube. m kinds of color.
Coloring each vertex, repeating is legal.
Please calculate the total number of different schemes. (if scheme A can be transformed into scheme B through any rotating or flipping, they are considered as the same scheme)
The answer may be too large, so please output the total number of different schemes mod 97654321.

Input

The input consists of several cases. Each case consists of two positive integers N and m (2 ≤ n ≤ 6, m ≤ 100000).

Output

For each case, output the total number of different schemes mod 97654321.

Sample Input

2 2
Sample Output

6

1个回答

caozhy
caozhy   Ds   Rxr 2017.09.12 23:53
已采纳
Csdn user default icon
上传中...
上传图片
插入图片