shunfurh
编程介的小学生
2017-08-28 14:21

Hypercube

  • as
  • scheme
  • each

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条回答

为你推荐