#include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(n); i++) string get_grid_rotate(int H, int W, string S, int h, int w){ string ans(H*W, ' '); rep(y,H) rep(x,W){ int nxy = (y + h) % H; int nxx = (x + w) % W; ans[nxy * W + nxx] = S[y * W + x]; } return ans; } i64 solve(int H, int W, int K){ int ans = 0; rep(c,1001001001){ string tmp; int p = c; rep(i,H*W){ tmp.push_back('0' + p%K); p /= K; } if(p != 0 && tmp == string(H*W, '0')) break; int ok = 1; rep(y,H) rep(x,W) if(get_grid_rotate(H,W,tmp,y,x) < tmp) ok = 0; rep(t,K) if(tmp.find('0' + t) == string::npos) ok = 0; ans += ok; } return ans; } int main(){ int H,W,K; cin >> H >> W >> K; cout << "const int answer_table[4][11][11] = {"; rep(k,4){ if(k) cout << ","; cout << "{"; rep(x,11){ if(x) cout << ","; cout << "{"; rep(y,11){ if(y) cout << ","; if(k==0){ cout << 0; continue; } if(x*y==0){ cout << 0; continue; } if(10