1. 程式人生 > >ACM 快速冪模板 HDU4365

ACM 快速冪模板 HDU4365

In addition fond of programing, Jack also loves painting. He likes to draw many interesting graphics on the paper. 
One day,Jack found a new interesting graph called Palindrome graph. No matter how many times to flip or rotate 90 degrees, the palindrome graph are always unchanged. 
Jack took a paper with n*n grid and K kinds of pigments.Some of the grid has been filled with color and can not be modified.Jack want to know:how many ways can he paint a palindrome graph?