#include <bits/stdc++.h> #define INF 2147483647 #define LINF 9223372036854775807 #define NINF -2147483648 #define NLINF -9223372036854775808 #define M 1000000007 #define M1 998244353 #define A 26 #define P 2137 using namespace std; using db=double; using dbl=long double; using ll=long long; using pi=pair<int,int>; using pl=pair<ll,ll>; using vi=vector<int>; using vl=vector<ll>; using gr=vector<vector<int> >; using grl=vector<vector<ll> >; #define fp(x, a, b) for (int (x) = (a); (x) < (b); (x)++) #define f(x, n) for (int (x) = 0; (x) < (n); (x)++) #define fnp(x, a, b) for (int (x) = (b) - 1; (x) >= (a); (x)--) #define fn(x, n) for (int (x) = (n - 1); (x) >= 0; (x)--) #define sgn(x) (x) > 0 ? 1 : (x) == 0 ? 0 : -1 #define gcd(a, b) __gcd((a), (b)) #define lcm(a, b) (a) * (b) / gcd((a), (b)) #define x first #define y second #define mp make_pair #define pb push_back #define s(x) x.size() #define all(x) x.begin(), x.end() #define ans(x) cout<<(x)<<"\n" #define yes cout<<"YES\n"; #define no cout<<"NO\n"; #define fl cout.flush() #define debarr(x, n) f(i, (n)){cout<<(x)[i]<<" ";}cout<<"\n" #define debgr(x, n) f(i, (n)){f(j, s((x)[i])){cout<<(x)[i][j]<<" ";}cout<<"\n";} mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); void input(); void compute(); int main() { int T = 1; //cin >> T; while(T--) { input(); compute(); } return 0; } int n; int m; int kk; int cnt[2]; int parity[2]; int par; ll w; ll good; bool board[8][8]; ll tab[9][9][9][9]; void input() { string tmp; cin >> n >> m; kk = 0; cnt[0] = cnt[1] = 0; par = 0; parity[0] = parity[1] = 0; w = good = 0; f(i, 8) { f(j, 8) { board[i][j] = false; } } f(i, n) { cin >> tmp; f(j, m) { if(tmp[j] == 'O') { cnt[(i + j) % 2]++; kk++; } } } f(i, n) { cin >> tmp; f(j, m) { if(tmp[j] == 'O') { board[i][j] = true; parity[(i + j) % 2]++; } } } } void preproc() { tab[1][2][0][1] = 1; tab[1][2][1][0] = 1; tab[1][3][0][1] = 2; tab[1][3][1][0] = 2; tab[1][3][0][2] = 0; tab[1][3][1][1] = 2; tab[1][3][2][0] = 2; tab[1][4][0][1] = 3; tab[1][4][1][0] = 3; tab[1][4][0][2] = 3; tab[1][4][1][1] = 6; tab[1][4][2][0] = 3; tab[1][4][0][3] = 0; tab[1][4][1][2] = 3; tab[1][4][2][1] = 3; tab[1][4][3][0] = 0; tab[1][5][0][1] = 4; tab[1][5][1][0] = 4; tab[1][5][0][2] = 4; tab[1][5][1][1] = 12; tab[1][5][2][0] = 8; tab[1][5][0][3] = 0; tab[1][5][1][2] = 8; tab[1][5][2][1] = 12; tab[1][5][3][0] = 4; tab[1][5][0][4] = 0; tab[1][5][1][3] = 0; tab[1][5][2][2] = 4; tab[1][5][3][1] = 4; tab[1][5][4][0] = 0; tab[1][6][0][1] = 5; tab[1][6][1][0] = 5; tab[1][6][0][2] = 10; tab[1][6][1][1] = 20; tab[1][6][2][0] = 10; tab[1][6][0][3] = 5; tab[1][6][1][2] = 25; tab[1][6][2][1] = 25; tab[1][6][3][0] = 5; tab[1][6][0][4] = 0; tab[1][6][1][3] = 10; tab[1][6][2][2] = 20; tab[1][6][3][1] = 10; tab[1][6][4][0] = 0; tab[1][6][0][5] = 0; tab[1][6][1][4] = 0; tab[1][6][2][3] = 5; tab[1][6][3][2] = 5; tab[1][6][4][1] = 0; tab[1][6][5][0] = 0; tab[1][7][0][1] = 6; tab[1][7][1][0] = 6; tab[1][7][0][2] = 12; tab[1][7][1][1] = 30; tab[1][7][2][0] = 18; tab[1][7][0][3] = 6; tab[1][7][1][2] = 42; tab[1][7][2][1] = 54; tab[1][7][3][0] = 18; tab[1][7][0][4] = 0; tab[1][7][1][3] = 18; tab[1][7][2][2] = 54; tab[1][7][3][1] = 42; tab[1][7][4][0] = 6; tab[1][7][0][5] = 0; tab[1][7][1][4] = 0; tab[1][7][2][3] = 18; tab[1][7][3][2] = 30; tab[1][7][4][1] = 12; tab[1][7][5][0] = 0; tab[1][7][0][6] = 0; tab[1][7][1][5] = 0; tab[1][7][2][4] = 0; tab[1][7][3][3] = 6; tab[1][7][4][2] = 6; tab[1][7][5][1] = 0; tab[1][7][6][0] = 0; tab[1][8][0][1] = 7; tab[1][8][1][0] = 7; tab[1][8][0][2] = 21; tab[1][8][1][1] = 42; tab[1][8][2][0] = 21; tab[1][8][0][3] = 21; tab[1][8][1][2] = 84; tab[1][8][2][1] = 84; tab[1][8][3][0] = 21; tab[1][8][0][4] = 7; tab[1][8][1][3] = 70; tab[1][8][2][2] = 126; tab[1][8][3][1] = 70; tab[1][8][4][0] = 7; tab[1][8][0][5] = 0; tab[1][8][1][4] = 21; tab[1][8][2][3] = 84; tab[1][8][3][2] = 84; tab[1][8][4][1] = 21; tab[1][8][5][0] = 0; tab[1][8][0][6] = 0; tab[1][8][1][5] = 0; tab[1][8][2][4] = 21; tab[1][8][3][3] = 42; tab[1][8][4][2] = 21; tab[1][8][5][1] = 0; tab[1][8][6][0] = 0; tab[1][8][0][7] = 0; tab[1][8][1][6] = 0; tab[1][8][2][5] = 0; tab[1][8][3][4] = 7; tab[1][8][4][3] = 7; tab[1][8][5][2] = 0; tab[1][8][6][1] = 0; tab[1][8][7][0] = 0; tab[2][1][0][1] = 1; tab[2][1][1][0] = 1; tab[2][2][0][1] = 4; tab[2][2][1][0] = 4; tab[2][2][0][2] = 4; tab[2][2][1][1] = 8; tab[2][2][2][0] = 4; tab[2][2][0][3] = 0; tab[2][2][1][2] = 4; tab[2][2][2][1] = 4; tab[2][2][3][0] = 0; tab[2][3][0][1] = 7; tab[2][3][1][0] = 7; tab[2][3][0][2] = 14; tab[2][3][1][1] = 28; tab[2][3][2][0] = 14; tab[2][3][0][3] = 7; tab[2][3][1][2] = 35; tab[2][3][2][1] = 35; tab[2][3][3][0] = 7; tab[2][3][0][4] = 0; tab[2][3][1][3] = 14; tab[2][3][2][2] = 28; tab[2][3][3][1] = 14; tab[2][3][4][0] = 0; tab[2][3][0][5] = 0; tab[2][3][1][4] = 0; tab[2][3][2][3] = 7; tab[2][3][3][2] = 7; tab[2][3][4][1] = 0; tab[2][3][5][0] = 0; tab[2][4][0][1] = 10; tab[2][4][1][0] = 10; tab[2][4][0][2] = 30; tab[2][4][1][1] = 60; tab[2][4][2][0] = 30; tab[2][4][0][3] = 30; tab[2][4][1][2] = 120; tab[2][4][2][1] = 120; tab[2][4][3][0] = 30; tab[2][4][0][4] = 10; tab[2][4][1][3] = 100; tab[2][4][2][2] = 180; tab[2][4][3][1] = 100; tab[2][4][4][0] = 10; tab[2][4][0][5] = 0; tab[2][4][1][4] = 30; tab[2][4][2][3] = 120; tab[2][4][3][2] = 120; tab[2][4][4][1] = 30; tab[2][4][5][0] = 0; tab[2][4][0][6] = 0; tab[2][4][1][5] = 0; tab[2][4][2][4] = 30; tab[2][4][3][3] = 60; tab[2][4][4][2] = 30; tab[2][4][5][1] = 0; tab[2][4][6][0] = 0; tab[2][4][0][7] = 0; tab[2][4][1][6] = 0; tab[2][4][2][5] = 0; tab[2][4][3][4] = 10; tab[2][4][4][3] = 10; tab[2][4][5][2] = 0; tab[2][4][6][1] = 0; tab[2][4][7][0] = 0; tab[2][5][0][1] = 13; tab[2][5][1][0] = 13; tab[2][5][0][2] = 52; tab[2][5][1][1] = 104; tab[2][5][2][0] = 52; tab[2][5][0][3] = 78; tab[2][5][1][2] = 286; tab[2][5][2][1] = 286; tab[2][5][3][0] = 78; tab[2][5][0][4] = 52; tab[2][5][1][3] = 364; tab[2][5][2][2] = 624; tab[2][5][3][1] = 364; tab[2][5][4][0] = 52; tab[2][5][0][5] = 13; tab[2][5][1][4] = 221; tab[2][5][2][3] = 676; tab[2][5][3][2] = 676; tab[2][5][4][1] = 221; tab[2][5][5][0] = 13; tab[2][5][0][6] = 0; tab[2][5][1][5] = 52; tab[2][5][2][4] = 364; tab[2][5][3][3] = 624; tab[2][5][4][2] = 364; tab[2][5][5][1] = 52; tab[2][5][6][0] = 0; tab[2][5][0][7] = 0; tab[2][5][1][6] = 0; tab[2][5][2][5] = 78; tab[2][5][3][4] = 286; tab[2][5][4][3] = 286; tab[2][5][5][2] = 78; tab[2][5][6][1] = 0; tab[2][5][7][0] = 0; tab[2][5][0][8] = 0; tab[2][5][1][7] = 0; tab[2][5][2][6] = 0; tab[2][5][3][5] = 52; tab[2][5][4][4] = 104; tab[2][5][5][3] = 52; tab[2][5][6][2] = 0; tab[2][5][7][1] = 0; tab[2][5][8][0] = 0; tab[2][6][0][1] = 16; tab[2][6][1][0] = 16; tab[2][6][0][2] = 80; tab[2][6][1][1] = 160; tab[2][6][2][0] = 80; tab[2][6][0][3] = 160; tab[2][6][1][2] = 560; tab[2][6][2][1] = 560; tab[2][6][3][0] = 160; tab[2][6][0][4] = 160; tab[2][6][1][3] = 960; tab[2][6][2][2] = 1600; tab[2][6][3][1] = 960; tab[2][6][4][0] = 160; tab[2][6][0][5] = 80; tab[2][6][1][4] = 880; tab[2][6][2][3] = 2400; tab[2][6][3][2] = 2400; tab[2][6][4][1] = 880; tab[2][6][5][0] = 80; tab[2][6][0][6] = 16; tab[2][6][1][5] = 416; tab[2][6][2][4] = 2000; tab[2][6][3][3] = 3200; tab[2][6][4][2] = 2000; tab[2][6][5][1] = 416; tab[2][6][6][0] = 16; tab[2][6][0][7] = 0; tab[2][6][1][6] = 80; tab[2][6][2][5] = 880; tab[2][6][3][4] = 2400; tab[2][6][4][3] = 2400; tab[2][6][5][2] = 880; tab[2][6][6][1] = 80; tab[2][6][7][0] = 0; tab[2][6][0][8] = 0; tab[2][6][1][7] = 0; tab[2][6][2][6] = 160; tab[2][6][3][5] = 960; tab[2][6][4][4] = 1600; tab[2][6][5][3] = 960; tab[2][6][6][2] = 160; tab[2][6][7][1] = 0; tab[2][6][8][0] = 0; tab[2][7][0][1] = 19; tab[2][7][1][0] = 19; tab[2][7][0][2] = 114; tab[2][7][1][1] = 228; tab[2][7][2][0] = 114; tab[2][7][0][3] = 285; tab[2][7][1][2] = 969; tab[2][7][2][1] = 969; tab[2][7][3][0] = 285; tab[2][7][0][4] = 380; tab[2][7][1][3] = 2090; tab[2][7][2][2] = 3420; tab[2][7][3][1] = 2090; tab[2][7][4][0] = 380; tab[2][7][0][5] = 285; tab[2][7][1][4] = 2565; tab[2][7][2][3] = 6555; tab[2][7][3][2] = 6555; tab[2][7][4][1] = 2565; tab[2][7][5][0] = 285; tab[2][7][0][6] = 114; tab[2][7][1][5] = 1824; tab[2][7][2][4] = 7410; tab[2][7][3][3] = 11400; tab[2][7][4][2] = 7410; tab[2][7][5][1] = 1824; tab[2][7][6][0] = 114; tab[2][7][0][7] = 19; tab[2][7][1][6] = 703; tab[2][7][2][5] = 4959; tab[2][7][3][4] = 11875; tab[2][7][4][3] = 11875; tab[2][7][5][2] = 4959; tab[2][7][6][1] = 703; tab[2][7][7][0] = 19; tab[2][7][0][8] = 0; tab[2][7][1][7] = 114; tab[2][7][2][6] = 1824; tab[2][7][3][5] = 7410; tab[2][7][4][4] = 11400; tab[2][7][5][3] = 7410; tab[2][7][6][2] = 1824; tab[2][7][7][1] = 114; tab[2][7][8][0] = 0; tab[2][8][0][1] = 22; tab[2][8][1][0] = 22; tab[2][8][0][2] = 154; tab[2][8][1][1] = 308; tab[2][8][2][0] = 154; tab[2][8][0][3] = 462; tab[2][8][1][2] = 1540; tab[2][8][2][1] = 1540; tab[2][8][3][0] = 462; tab[2][8][0][4] = 770; tab[2][8][1][3] = 4004; tab[2][8][2][2] = 6468; tab[2][8][3][1] = 4004; tab[2][8][4][0] = 770; tab[2][8][0][5] = 770; tab[2][8][1][4] = 6160; tab[2][8][2][3] = 15092; tab[2][8][3][2] = 15092; tab[2][8][4][1] = 6160; tab[2][8][5][0] = 770; tab[2][8][0][6] = 462; tab[2][8][1][5] = 5852; tab[2][8][2][4] = 21560; tab[2][8][3][3] = 32340; tab[2][8][4][2] = 21560; tab[2][8][5][1] = 5852; tab[2][8][6][0] = 462; tab[2][8][0][7] = 154; tab[2][8][1][6] = 3388; tab[2][8][2][5] = 19404; tab[2][8][3][4] = 43120; tab[2][8][4][3] = 43120; tab[2][8][5][2] = 19404; tab[2][8][6][1] = 3388; tab[2][8][7][0] = 154; tab[2][8][0][8] = 22; tab[2][8][1][7] = 1100; tab[2][8][2][6] = 10780; tab[2][8][3][5] = 36652; tab[2][8][4][4] = 53900; tab[2][8][5][3] = 36652; tab[2][8][6][2] = 10780; tab[2][8][7][1] = 1100; tab[2][8][8][0] = 22; tab[3][1][0][1] = 2; tab[3][1][1][0] = 2; tab[3][1][0][2] = 0; tab[3][1][1][1] = 2; tab[3][1][2][0] = 2; tab[3][2][0][1] = 7; tab[3][2][1][0] = 7; tab[3][2][0][2] = 14; tab[3][2][1][1] = 28; tab[3][2][2][0] = 14; tab[3][2][0][3] = 7; tab[3][2][1][2] = 35; tab[3][2][2][1] = 35; tab[3][2][3][0] = 7; tab[3][2][0][4] = 0; tab[3][2][1][3] = 14; tab[3][2][2][2] = 28; tab[3][2][3][1] = 14; tab[3][2][4][0] = 0; tab[3][2][0][5] = 0; tab[3][2][1][4] = 0; tab[3][2][2][3] = 7; tab[3][2][3][2] = 7; tab[3][2][4][1] = 0; tab[3][2][5][0] = 0; tab[3][3][0][1] = 12; tab[3][3][1][0] = 12; tab[3][3][0][2] = 36; tab[3][3][1][1] = 84; tab[3][3][2][0] = 48; tab[3][3][0][3] = 36; tab[3][3][1][2] = 180; tab[3][3][2][1] = 216; tab[3][3][3][0] = 72; tab[3][3][0][4] = 12; tab[3][3][1][3] = 156; tab[3][3][2][2] = 360; tab[3][3][3][1] = 264; tab[3][3][4][0] = 48; tab[3][3][0][5] = 0; tab[3][3][1][4] = 48; tab[3][3][2][3] = 264; tab[3][3][3][2] = 360; tab[3][3][4][1] = 156; tab[3][3][5][0] = 12; tab[3][3][0][6] = 0; tab[3][3][1][5] = 0; tab[3][3][2][4] = 72; tab[3][3][3][3] = 216; tab[3][3][4][2] = 180; tab[3][3][5][1] = 36; tab[3][3][6][0] = 0; tab[3][3][0][7] = 0; tab[3][3][1][6] = 0; tab[3][3][2][5] = 0; tab[3][3][3][4] = 48; tab[3][3][4][3] = 84; tab[3][3][5][2] = 36; tab[3][3][6][1] = 0; tab[3][3][7][0] = 0; tab[3][3][0][8] = 0; tab[3][3][1][7] = 0; tab[3][3][2][6] = 0; tab[3][3][3][5] = 0; tab[3][3][4][4] = 12; tab[3][3][5][3] = 12; tab[3][3][6][2] = 0; tab[3][3][7][1] = 0; tab[3][3][8][0] = 0; tab[3][4][0][1] = 17; tab[3][4][1][0] = 17; tab[3][4][0][2] = 85; tab[3][4][1][1] = 170; tab[3][4][2][0] = 85; tab[3][4][0][3] = 170; tab[3][4][1][2] = 595; tab[3][4][2][1] = 595; tab[3][4][3][0] = 170; tab[3][4][0][4] = 170; tab[3][4][1][3] = 1020; tab[3][4][2][2] = 1700; tab[3][4][3][1] = 1020; tab[3][4][4][0] = 170; tab[3][4][0][5] = 85; tab[3][4][1][4] = 935; tab[3][4][2][3] = 2550; tab[3][4][3][2] = 2550; tab[3][4][4][1] = 935; tab[3][4][5][0] = 85; tab[3][4][0][6] = 17; tab[3][4][1][5] = 442; tab[3][4][2][4] = 2125; tab[3][4][3][3] = 3400; tab[3][4][4][2] = 2125; tab[3][4][5][1] = 442; tab[3][4][6][0] = 17; tab[3][4][0][7] = 0; tab[3][4][1][6] = 85; tab[3][4][2][5] = 935; tab[3][4][3][4] = 2550; tab[3][4][4][3] = 2550; tab[3][4][5][2] = 935; tab[3][4][6][1] = 85; tab[3][4][7][0] = 0; tab[3][4][0][8] = 0; tab[3][4][1][7] = 0; tab[3][4][2][6] = 170; tab[3][4][3][5] = 1020; tab[3][4][4][4] = 1700; tab[3][4][5][3] = 1020; tab[3][4][6][2] = 170; tab[3][4][7][1] = 0; tab[3][4][8][0] = 0; tab[3][5][0][1] = 22; tab[3][5][1][0] = 22; tab[3][5][0][2] = 132; tab[3][5][1][1] = 286; tab[3][5][2][0] = 154; tab[3][5][0][3] = 330; tab[3][5][1][2] = 1254; tab[3][5][2][1] = 1386; tab[3][5][3][0] = 462; tab[3][5][0][4] = 440; tab[3][5][1][3] = 2750; tab[3][5][2][2] = 5082; tab[3][5][3][1] = 3542; tab[3][5][4][0] = 770; tab[3][5][0][5] = 330; tab[3][5][1][4] = 3410; tab[3][5][2][3] = 10010; tab[3][5][3][2] = 11550; tab[3][5][4][1] = 5390; tab[3][5][5][0] = 770; tab[3][5][0][6] = 132; tab[3][5][1][5] = 2442; tab[3][5][2][4] = 11550; tab[3][5][3][3] = 20790; tab[3][5][4][2] = 16170; tab[3][5][5][1] = 5082; tab[3][5][6][0] = 462; tab[3][5][0][7] = 22; tab[3][5][1][6] = 946; tab[3][5][2][5] = 7854; tab[3][5][3][4] = 22330; tab[3][5][4][3] = 26950; tab[3][5][5][2] = 14322; tab[3][5][6][1] = 2926; tab[3][5][7][0] = 154; tab[3][5][0][8] = 0; tab[3][5][1][7] = 154; tab[3][5][2][6] = 2926; tab[3][5][3][5] = 14322; tab[3][5][4][4] = 26950; tab[3][5][5][3] = 22330; tab[3][5][6][2] = 7854; tab[3][5][7][1] = 946; tab[3][5][8][0] = 22; tab[3][6][0][1] = 27; tab[3][6][1][0] = 27; tab[3][6][0][2] = 216; tab[3][6][1][1] = 432; tab[3][6][2][0] = 216; tab[3][6][0][3] = 756; tab[3][6][1][2] = 2484; tab[3][6][2][1] = 2484; tab[3][6][3][0] = 756; tab[3][6][0][4] = 1512; tab[3][6][1][3] = 7560; tab[3][6][2][2] = 12096; tab[3][6][3][1] = 7560; tab[3][6][4][0] = 1512; tab[3][6][0][5] = 1890; tab[3][6][1][4] = 13986; tab[3][6][2][3] = 33264; tab[3][6][3][2] = 33264; tab[3][6][4][1] = 13986; tab[3][6][5][0] = 1890; tab[3][6][0][6] = 1512; tab[3][6][1][5] = 16632; tab[3][6][2][4] = 57456; tab[3][6][3][3] = 84672; tab[3][6][4][2] = 57456; tab[3][6][5][1] = 16632; tab[3][6][6][0] = 1512; tab[3][6][0][7] = 756; tab[3][6][1][6] = 12852; tab[3][6][2][5] = 65016; tab[3][6][3][4] = 137592; tab[3][6][4][3] = 137592; tab[3][6][5][2] = 65016; tab[3][6][6][1] = 12852; tab[3][6][7][0] = 756; tab[3][6][0][8] = 216; tab[3][6][1][7] = 6264; tab[3][6][2][6] = 48384; tab[3][6][3][5] = 148176; tab[3][6][4][4] = 211680; tab[3][6][5][3] = 148176; tab[3][6][6][2] = 48384; tab[3][6][7][1] = 6264; tab[3][6][8][0] = 216; tab[3][7][0][1] = 32; tab[3][7][1][0] = 32; tab[3][7][0][2] = 288; tab[3][7][1][1] = 608; tab[3][7][2][0] = 320; tab[3][7][0][3] = 1152; tab[3][7][1][2] = 4032; tab[3][7][2][1] = 4320; tab[3][7][3][0] = 1440; tab[3][7][0][4] = 2688; tab[3][7][1][3] = 14208; tab[3][7][2][2] = 24480; tab[3][7][3][1] = 16800; tab[3][7][4][0] = 3840; tab[3][7][0][5] = 4032; tab[3][7][1][4] = 30912; tab[3][7][2][3] = 78720; tab[3][7][3][2] = 86400; tab[3][7][4][1] = 41280; tab[3][7][5][0] = 6720; tab[3][7][0][6] = 4032; tab[3][7][1][5] = 44352; tab[3][7][2][4] = 161280; tab[3][7][3][3] = 259200; tab[3][7][4][2] = 198720; tab[3][7][5][1] = 68544; tab[3][7][6][0] = 8064; tab[3][7][0][7] = 2688; tab[3][7][1][6] = 43008; tab[3][7][2][5] = 221760; tab[3][7][3][4] = 504000; tab[3][7][4][3] = 564480; tab[3][7][5][2] = 314496; tab[3][7][6][1] = 79296; tab[3][7][7][0] = 6720; tab[3][7][0][8] = 1152; tab[3][7][1][7] = 28032; tab[3][7][2][6] = 208320; tab[3][7][3][5] = 665280; tab[3][7][4][4] = 1048320; tab[3][7][5][3] = 854784; tab[3][7][6][2] = 350784; tab[3][7][7][1] = 64320; tab[3][7][8][0] = 3840; tab[3][8][0][1] = 37; tab[3][8][1][0] = 37; tab[3][8][0][2] = 407; tab[3][8][1][1] = 814; tab[3][8][2][0] = 407; tab[3][8][0][3] = 2035; tab[3][8][1][2] = 6512; tab[3][8][2][1] = 6512; tab[3][8][3][0] = 2035; tab[3][8][0][4] = 6105; tab[3][8][1][3] = 28490; tab[3][8][2][2] = 44770; tab[3][8][3][1] = 28490; tab[3][8][4][0] = 6105; tab[3][8][0][5] = 12210; tab[3][8][1][4] = 79365; tab[3][8][2][3] = 179080; tab[3][8][3][2] = 179080; tab[3][8][4][1] = 79365; tab[3][8][5][0] = 12210; tab[3][8][0][6] = 17094; tab[3][8][1][5] = 151404; tab[3][8][2][4] = 470085; tab[3][8][3][3] = 671550; tab[3][8][4][2] = 470085; tab[3][8][5][1] = 151404; tab[3][8][6][0] = 17094; tab[3][8][0][7] = 17094; tab[3][8][1][6] = 205128; tab[3][8][2][5] = 859584; tab[3][8][3][4] = 1678875; tab[3][8][4][3] = 1678875; tab[3][8][5][2] = 859584; tab[3][8][6][1] = 205128; tab[3][8][7][0] = 17094; tab[3][8][0][8] = 12210; tab[3][8][1][7] = 200244; tab[3][8][2][6] = 1128204; tab[3][8][3][5] = 2954820; tab[3][8][4][4] = 4029300; tab[3][8][5][3] = 2954820; tab[3][8][6][2] = 1128204; tab[3][8][7][1] = 200244; tab[3][8][8][0] = 12210; tab[4][1][0][1] = 3; tab[4][1][1][0] = 3; tab[4][1][0][2] = 3; tab[4][1][1][1] = 6; tab[4][1][2][0] = 3; tab[4][1][0][3] = 0; tab[4][1][1][2] = 3; tab[4][1][2][1] = 3; tab[4][1][3][0] = 0; tab[4][2][0][1] = 10; tab[4][2][1][0] = 10; tab[4][2][0][2] = 30; tab[4][2][1][1] = 60; tab[4][2][2][0] = 30; tab[4][2][0][3] = 30; tab[4][2][1][2] = 120; tab[4][2][2][1] = 120; tab[4][2][3][0] = 30; tab[4][2][0][4] = 10; tab[4][2][1][3] = 100; tab[4][2][2][2] = 180; tab[4][2][3][1] = 100; tab[4][2][4][0] = 10; tab[4][2][0][5] = 0; tab[4][2][1][4] = 30; tab[4][2][2][3] = 120; tab[4][2][3][2] = 120; tab[4][2][4][1] = 30; tab[4][2][5][0] = 0; tab[4][2][0][6] = 0; tab[4][2][1][5] = 0; tab[4][2][2][4] = 30; tab[4][2][3][3] = 60; tab[4][2][4][2] = 30; tab[4][2][5][1] = 0; tab[4][2][6][0] = 0; tab[4][2][0][7] = 0; tab[4][2][1][6] = 0; tab[4][2][2][5] = 0; tab[4][2][3][4] = 10; tab[4][2][4][3] = 10; tab[4][2][5][2] = 0; tab[4][2][6][1] = 0; tab[4][2][7][0] = 0; tab[4][3][0][1] = 17; tab[4][3][1][0] = 17; tab[4][3][0][2] = 85; tab[4][3][1][1] = 170; tab[4][3][2][0] = 85; tab[4][3][0][3] = 170; tab[4][3][1][2] = 595; tab[4][3][2][1] = 595; tab[4][3][3][0] = 170; tab[4][3][0][4] = 170; tab[4][3][1][3] = 1020; tab[4][3][2][2] = 1700; tab[4][3][3][1] = 1020; tab[4][3][4][0] = 170; tab[4][3][0][5] = 85; tab[4][3][1][4] = 935; tab[4][3][2][3] = 2550; tab[4][3][3][2] = 2550; tab[4][3][4][1] = 935; tab[4][3][5][0] = 85; tab[4][3][0][6] = 17; tab[4][3][1][5] = 442; tab[4][3][2][4] = 2125; tab[4][3][3][3] = 3400; tab[4][3][4][2] = 2125; tab[4][3][5][1] = 442; tab[4][3][6][0] = 17; tab[4][3][0][7] = 0; tab[4][3][1][6] = 85; tab[4][3][2][5] = 935; tab[4][3][3][4] = 2550; tab[4][3][4][3] = 2550; tab[4][3][5][2] = 935; tab[4][3][6][1] = 85; tab[4][3][7][0] = 0; tab[4][3][0][8] = 0; tab[4][3][1][7] = 0; tab[4][3][2][6] = 170; tab[4][3][3][5] = 1020; tab[4][3][4][4] = 1700; tab[4][3][5][3] = 1020; tab[4][3][6][2] = 170; tab[4][3][7][1] = 0; tab[4][3][8][0] = 0; tab[4][4][0][1] = 24; tab[4][4][1][0] = 24; tab[4][4][0][2] = 168; tab[4][4][1][1] = 336; tab[4][4][2][0] = 168; tab[4][4][0][3] = 504; tab[4][4][1][2] = 1680; tab[4][4][2][1] = 1680; tab[4][4][3][0] = 504; tab[4][4][0][4] = 840; tab[4][4][1][3] = 4368; tab[4][4][2][2] = 7056; tab[4][4][3][1] = 4368; tab[4][4][4][0] = 840; tab[4][4][0][5] = 840; tab[4][4][1][4] = 6720; tab[4][4][2][3] = 16464; tab[4][4][3][2] = 16464; tab[4][4][4][1] = 6720; tab[4][4][5][0] = 840; tab[4][4][0][6] = 504; tab[4][4][1][5] = 6384; tab[4][4][2][4] = 23520; tab[4][4][3][3] = 35280; tab[4][4][4][2] = 23520; tab[4][4][5][1] = 6384; tab[4][4][6][0] = 504; tab[4][4][0][7] = 168; tab[4][4][1][6] = 3696; tab[4][4][2][5] = 21168; tab[4][4][3][4] = 47040; tab[4][4][4][3] = 47040; tab[4][4][5][2] = 21168; tab[4][4][6][1] = 3696; tab[4][4][7][0] = 168; tab[4][4][0][8] = 24; tab[4][4][1][7] = 1200; tab[4][4][2][6] = 11760; tab[4][4][3][5] = 39984; tab[4][4][4][4] = 58800; tab[4][4][5][3] = 39984; tab[4][4][6][2] = 11760; tab[4][4][7][1] = 1200; tab[4][4][8][0] = 24; tab[4][5][0][1] = 31; tab[4][5][1][0] = 31; tab[4][5][0][2] = 279; tab[4][5][1][1] = 558; tab[4][5][2][0] = 279; tab[4][5][0][3] = 1116; tab[4][5][1][2] = 3627; tab[4][5][2][1] = 3627; tab[4][5][3][0] = 1116; tab[4][5][0][4] = 2604; tab[4][5][1][3] = 12648; tab[4][5][2][2] = 20088; tab[4][5][3][1] = 12648; tab[4][5][4][0] = 2604; tab[4][5][0][5] = 3906; tab[4][5][1][4] = 27342; tab[4][5][2][3] = 63612; tab[4][5][3][2] = 63612; tab[4][5][4][1] = 27342; tab[4][5][5][0] = 3906; tab[4][5][0][6] = 3906; tab[4][5][1][5] = 39060; tab[4][5][2][4] = 128898; tab[4][5][3][3] = 187488; tab[4][5][4][2] = 128898; tab[4][5][5][1] = 39060; tab[4][5][6][0] = 3906; tab[4][5][0][7] = 2604; tab[4][5][1][6] = 37758; tab[4][5][2][5] = 175770; tab[4][5][3][4] = 359352; tab[4][5][4][3] = 359352; tab[4][5][5][2] = 175770; tab[4][5][6][1] = 37758; tab[4][5][7][0] = 2604; tab[4][5][0][8] = 1116; tab[4][5][1][7] = 24552; tab[4][5][2][6] = 164052; tab[4][5][3][5] = 468720; tab[4][5][4][4] = 656208; tab[4][5][5][3] = 468720; tab[4][5][6][2] = 164052; tab[4][5][7][1] = 24552; tab[4][5][8][0] = 1116; tab[4][6][0][1] = 38; tab[4][6][1][0] = 38; tab[4][6][0][2] = 418; tab[4][6][1][1] = 836; tab[4][6][2][0] = 418; tab[4][6][0][3] = 2090; tab[4][6][1][2] = 6688; tab[4][6][2][1] = 6688; tab[4][6][3][0] = 2090; tab[4][6][0][4] = 6270; tab[4][6][1][3] = 29260; tab[4][6][2][2] = 45980; tab[4][6][3][1] = 29260; tab[4][6][4][0] = 6270; tab[4][6][0][5] = 12540; tab[4][6][1][4] = 81510; tab[4][6][2][3] = 183920; tab[4][6][3][2] = 183920; tab[4][6][4][1] = 81510; tab[4][6][5][0] = 12540; tab[4][6][0][6] = 17556; tab[4][6][1][5] = 155496; tab[4][6][2][4] = 482790; tab[4][6][3][3] = 689700; tab[4][6][4][2] = 482790; tab[4][6][5][1] = 155496; tab[4][6][6][0] = 17556; tab[4][6][0][7] = 17556; tab[4][6][1][6] = 210672; tab[4][6][2][5] = 882816; tab[4][6][3][4] = 1724250; tab[4][6][4][3] = 1724250; tab[4][6][5][2] = 882816; tab[4][6][6][1] = 210672; tab[4][6][7][0] = 17556; tab[4][6][0][8] = 12540; tab[4][6][1][7] = 205656; tab[4][6][2][6] = 1158696; tab[4][6][3][5] = 3034680; tab[4][6][4][4] = 4138200; tab[4][6][5][3] = 3034680; tab[4][6][6][2] = 1158696; tab[4][6][7][1] = 205656; tab[4][6][8][0] = 12540; tab[4][7][0][1] = 45; tab[4][7][1][0] = 45; tab[4][7][0][2] = 585; tab[4][7][1][1] = 1170; tab[4][7][2][0] = 585; tab[4][7][0][3] = 3510; tab[4][7][1][2] = 11115; tab[4][7][2][1] = 11115; tab[4][7][3][0] = 3510; tab[4][7][0][4] = 12870; tab[4][7][1][3] = 58500; tab[4][7][2][2] = 91260; tab[4][7][3][1] = 58500; tab[4][7][4][0] = 12870; tab[4][7][0][5] = 32175; tab[4][7][1][4] = 199485; tab[4][7][2][3] = 441090; tab[4][7][3][2] = 441090; tab[4][7][4][1] = 199485; tab[4][7][5][0] = 32175; tab[4][7][0][6] = 57915; tab[4][7][1][5] = 476190; tab[4][7][2][4] = 1422135; tab[4][7][3][3] = 2007720; tab[4][7][4][2] = 1422135; tab[4][7][5][1] = 476190; tab[4][7][6][0] = 57915; tab[4][7][0][7] = 77220; tab[4][7][1][6] = 830115; tab[4][7][2][5] = 3262545; tab[4][7][3][4] = 6190470; tab[4][7][4][3] = 6190470; tab[4][7][5][2] = 3262545; tab[4][7][6][1] = 830115; tab[4][7][7][0] = 77220; tab[4][7][0][8] = 77220; tab[4][7][1][7] = 1081080; tab[4][7][2][6] = 5521230; tab[4][7][3][5] = 13719420; tab[4][7][4][4] = 18404100; tab[4][7][5][3] = 13719420; tab[4][7][6][2] = 5521230; tab[4][7][7][1] = 1081080; tab[4][7][8][0] = 77220; tab[4][8][0][1] = 52; tab[4][8][1][0] = 52; tab[4][8][0][2] = 780; tab[4][8][1][1] = 1560; tab[4][8][2][0] = 780; tab[4][8][0][3] = 5460; tab[4][8][1][2] = 17160; tab[4][8][2][1] = 17160; tab[4][8][3][0] = 5460; tab[4][8][0][4] = 23660; tab[4][8][1][3] = 105560; tab[4][8][2][2] = 163800; tab[4][8][3][1] = 105560; tab[4][8][4][0] = 23660; tab[4][8][0][5] = 70980; tab[4][8][1][4] = 425880; tab[4][8][2][3] = 928200; tab[4][8][3][2] = 928200; tab[4][8][4][1] = 425880; tab[4][8][5][0] = 70980; tab[4][8][0][6] = 156156; tab[4][8][1][5] = 1220856; tab[4][8][2][4] = 3549000; tab[4][8][3][3] = 4968600; tab[4][8][4][2] = 3549000; tab[4][8][5][1] = 1220856; tab[4][8][6][0] = 156156; tab[4][8][0][7] = 260260; tab[4][8][1][6] = 2602600; tab[4][8][2][5] = 9795240; tab[4][8][3][4] = 18218200; tab[4][8][4][3] = 18218200; tab[4][8][5][2] = 9795240; tab[4][8][6][1] = 2602600; tab[4][8][7][0] = 260260; tab[4][8][0][8] = 334620; tab[4][8][1][7] = 4238520; tab[4][8][2][6] = 20300280; tab[4][8][3][5] = 48692280; tab[4][8][4][4] = 64591800; tab[4][8][5][3] = 48692280; tab[4][8][6][2] = 20300280; tab[4][8][7][1] = 4238520; tab[4][8][8][0] = 334620; tab[5][1][0][1] = 4; tab[5][1][1][0] = 4; tab[5][1][0][2] = 4; tab[5][1][1][1] = 12; tab[5][1][2][0] = 8; tab[5][1][0][3] = 0; tab[5][1][1][2] = 8; tab[5][1][2][1] = 12; tab[5][1][3][0] = 4; tab[5][1][0][4] = 0; tab[5][1][1][3] = 0; tab[5][1][2][2] = 4; tab[5][1][3][1] = 4; tab[5][1][4][0] = 0; tab[5][2][0][1] = 13; tab[5][2][1][0] = 13; tab[5][2][0][2] = 52; tab[5][2][1][1] = 104; tab[5][2][2][0] = 52; tab[5][2][0][3] = 78; tab[5][2][1][2] = 286; tab[5][2][2][1] = 286; tab[5][2][3][0] = 78; tab[5][2][0][4] = 52; tab[5][2][1][3] = 364; tab[5][2][2][2] = 624; tab[5][2][3][1] = 364; tab[5][2][4][0] = 52; tab[5][2][0][5] = 13; tab[5][2][1][4] = 221; tab[5][2][2][3] = 676; tab[5][2][3][2] = 676; tab[5][2][4][1] = 221; tab[5][2][5][0] = 13; tab[5][2][0][6] = 0; tab[5][2][1][5] = 52; tab[5][2][2][4] = 364; tab[5][2][3][3] = 624; tab[5][2][4][2] = 364; tab[5][2][5][1] = 52; tab[5][2][6][0] = 0; tab[5][2][0][7] = 0; tab[5][2][1][6] = 0; tab[5][2][2][5] = 78; tab[5][2][3][4] = 286; tab[5][2][4][3] = 286; tab[5][2][5][2] = 78; tab[5][2][6][1] = 0; tab[5][2][7][0] = 0; tab[5][2][0][8] = 0; tab[5][2][1][7] = 0; tab[5][2][2][6] = 0; tab[5][2][3][5] = 52; tab[5][2][4][4] = 104; tab[5][2][5][3] = 52; tab[5][2][6][2] = 0; tab[5][2][7][1] = 0; tab[5][2][8][0] = 0; tab[5][3][0][1] = 22; tab[5][3][1][0] = 22; tab[5][3][0][2] = 132; tab[5][3][1][1] = 286; tab[5][3][2][0] = 154; tab[5][3][0][3] = 330; tab[5][3][1][2] = 1254; tab[5][3][2][1] = 1386; tab[5][3][3][0] = 462; tab[5][3][0][4] = 440; tab[5][3][1][3] = 2750; tab[5][3][2][2] = 5082; tab[5][3][3][1] = 3542; tab[5][3][4][0] = 770; tab[5][3][0][5] = 330; tab[5][3][1][4] = 3410; tab[5][3][2][3] = 10010; tab[5][3][3][2] = 11550; tab[5][3][4][1] = 5390; tab[5][3][5][0] = 770; tab[5][3][0][6] = 132; tab[5][3][1][5] = 2442; tab[5][3][2][4] = 11550; tab[5][3][3][3] = 20790; tab[5][3][4][2] = 16170; tab[5][3][5][1] = 5082; tab[5][3][6][0] = 462; tab[5][3][0][7] = 22; tab[5][3][1][6] = 946; tab[5][3][2][5] = 7854; tab[5][3][3][4] = 22330; tab[5][3][4][3] = 26950; tab[5][3][5][2] = 14322; tab[5][3][6][1] = 2926; tab[5][3][7][0] = 154; tab[5][3][0][8] = 0; tab[5][3][1][7] = 154; tab[5][3][2][6] = 2926; tab[5][3][3][5] = 14322; tab[5][3][4][4] = 26950; tab[5][3][5][3] = 22330; tab[5][3][6][2] = 7854; tab[5][3][7][1] = 946; tab[5][3][8][0] = 22; tab[5][4][0][1] = 31; tab[5][4][1][0] = 31; tab[5][4][0][2] = 279; tab[5][4][1][1] = 558; tab[5][4][2][0] = 279; tab[5][4][0][3] = 1116; tab[5][4][1][2] = 3627; tab[5][4][2][1] = 3627; tab[5][4][3][0] = 1116; tab[5][4][0][4] = 2604; tab[5][4][1][3] = 12648; tab[5][4][2][2] = 20088; tab[5][4][3][1] = 12648; tab[5][4][4][0] = 2604; tab[5][4][0][5] = 3906; tab[5][4][1][4] = 27342; tab[5][4][2][3] = 63612; tab[5][4][3][2] = 63612; tab[5][4][4][1] = 27342; tab[5][4][5][0] = 3906; tab[5][4][0][6] = 3906; tab[5][4][1][5] = 39060; tab[5][4][2][4] = 128898; tab[5][4][3][3] = 187488; tab[5][4][4][2] = 128898; tab[5][4][5][1] = 39060; tab[5][4][6][0] = 3906; tab[5][4][0][7] = 2604; tab[5][4][1][6] = 37758; tab[5][4][2][5] = 175770; tab[5][4][3][4] = 359352; tab[5][4][4][3] = 359352; tab[5][4][5][2] = 175770; tab[5][4][6][1] = 37758; tab[5][4][7][0] = 2604; tab[5][4][0][8] = 1116; tab[5][4][1][7] = 24552; tab[5][4][2][6] = 164052; tab[5][4][3][5] = 468720; tab[5][4][4][4] = 656208; tab[5][4][5][3] = 468720; tab[5][4][6][2] = 164052; tab[5][4][7][1] = 24552; tab[5][4][8][0] = 1116; tab[5][5][0][1] = 40; tab[5][5][1][0] = 40; tab[5][5][0][2] = 440; tab[5][5][1][1] = 920; tab[5][5][2][0] = 480; tab[5][5][0][3] = 2200; tab[5][5][1][2] = 7480; tab[5][5][2][1] = 7920; tab[5][5][3][0] = 2640; tab[5][5][0][4] = 6600; tab[5][5][1][3] = 33000; tab[5][5][2][2] = 55440; tab[5][5][3][1] = 37840; tab[5][5][4][0] = 8800; tab[5][5][0][5] = 13200; tab[5][5][1][4] = 92400; tab[5][5][2][3] = 224400; tab[5][5][3][2] = 242000; tab[5][5][4][1] = 116600; tab[5][5][5][0] = 19800; tab[5][5][0][6] = 18480; tab[5][5][1][5] = 176880; tab[5][5][2][4] = 594000; tab[5][5][3][3] = 919600; tab[5][5][4][2] = 701800; tab[5][5][5][1] = 249480; tab[5][5][6][0] = 31680; tab[5][5][0][7] = 18480; tab[5][5][1][6] = 240240; tab[5][5][2][5] = 1092960; tab[5][5][3][4] = 2323200; tab[5][5][4][3] = 2541000; tab[5][5][5][2] = 1437480; tab[5][5][6][1] = 385440; tab[5][5][7][0] = 36960; tab[5][5][0][8] = 13200; tab[5][5][1][7] = 234960; tab[5][5][2][6] = 1441440; tab[5][5][3][5] = 4123680; tab[5][5][4][4] = 6171000; tab[5][5][5][3] = 5009400; tab[5][5][6][2] = 2148960; tab[5][5][7][1] = 438240; tab[5][5][8][0] = 31680; tab[5][6][0][1] = 49; tab[5][6][1][0] = 49; tab[5][6][0][2] = 686; tab[5][6][1][1] = 1372; tab[5][6][2][0] = 686; tab[5][6][0][3] = 4459; tab[5][6][1][2] = 14063; tab[5][6][2][1] = 14063; tab[5][6][3][0] = 4459; tab[5][6][0][4] = 17836; tab[5][6][1][3] = 80262; tab[5][6][2][2] = 124852; tab[5][6][3][1] = 80262; tab[5][6][4][0] = 17836; tab[5][6][0][5] = 49049; tab[5][6][1][4] = 298753; tab[5][6][2][3] = 655473; tab[5][6][3][2] = 655473; tab[5][6][4][1] = 298753; tab[5][6][5][0] = 49049; tab[5][6][0][6] = 98098; tab[5][6][1][5] = 784784; tab[5][6][2][4] = 2309762; tab[5][6][3][3] = 3246152; tab[5][6][4][2] = 2309762; tab[5][6][5][1] = 784784; tab[5][6][6][0] = 98098; tab[5][6][0][7] = 147147; tab[5][6][1][6] = 1520519; tab[5][6][2][5] = 5836831; tab[5][6][3][4] = 10955763; tab[5][6][4][3] = 10955763; tab[5][6][5][2] = 5836831; tab[5][6][6][1] = 1520519; tab[5][6][7][0] = 147147; tab[5][6][0][8] = 168168; tab[5][6][1][7] = 2228226; tab[5][6][2][6] = 10986976; tab[5][6][3][5] = 26780754; tab[5][6][4][4] = 35707672; tab[5][6][5][3] = 26780754; tab[5][6][6][2] = 10986976; tab[5][6][7][1] = 2228226; tab[5][6][8][0] = 168168; tab[5][7][0][1] = 58; tab[5][7][1][0] = 58; tab[5][7][0][2] = 928; tab[5][7][1][1] = 1914; tab[5][7][2][0] = 986; tab[5][7][0][3] = 6960; tab[5][7][1][2] = 22736; tab[5][7][2][1] = 23664; tab[5][7][3][0] = 7888; tab[5][7][0][4] = 32480; tab[5][7][1][3] = 150800; tab[5][7][2][2] = 244528; tab[5][7][3][1] = 165648; tab[5][7][4][0] = 39440; tab[5][7][0][5] = 105560; tab[5][7][1][4] = 657720; tab[5][7][2][3] = 1498720; tab[5][7][3][2] = 1577600; tab[5][7][4][1] = 769080; tab[5][7][5][0] = 138040; tab[5][7][0][6] = 253344; tab[5][7][1][5] = 2047864; tab[5][7][2][4] = 6211800; tab[5][7][3][3] = 9150080; tab[5][7][4][2] = 6941440; tab[5][7][5][1] = 2567544; tab[5][7][6][0] = 358904; tab[5][7][0][7] = 464464; tab[5][7][1][6] = 4771312; tab[5][7][2][5] = 18663008; tab[5][7][3][4] = 36442560; tab[5][7][4][3] = 38651200; tab[5][7][5][2] = 22307264; tab[5][7][6][1] = 6460272; tab[5][7][7][0] = 717808; tab[5][7][0][8] = 663520; tab[5][7][1][7] = 8559408; tab[5][7][2][6] = 42350672; tab[5][7][3][5] = 106235584; tab[5][7][4][4] = 149083200; tab[5][7][5][3] = 120370880; tab[5][7][6][2] = 54553408; tab[5][7][7][1] = 12612912; tab[5][7][8][0] = 1127984; tab[5][8][0][1] = 67; tab[5][8][1][0] = 67; tab[5][8][0][2] = 1273; tab[5][8][1][1] = 2546; tab[5][8][2][0] = 1273; tab[5][8][0][3] = 11457; tab[5][8][1][2] = 35644; tab[5][8][2][1] = 35644; tab[5][8][3][0] = 11457; tab[5][8][0][4] = 64923; tab[5][8][1][3] = 282606; tab[5][8][2][2] = 435366; tab[5][8][3][1] = 282606; tab[5][8][4][0] = 64923; tab[5][8][0][5] = 259692; tab[5][8][1][4] = 1493229; tab[5][8][2][3] = 3192684; tab[5][8][3][2] = 3192684; tab[5][8][4][1] = 1493229; tab[5][8][5][0] = 259692; tab[5][8][0][6] = 779076; tab[5][8][1][5] = 5713224; tab[5][8][2][4] = 16035981; tab[5][8][3][3] = 22203666; tab[5][8][4][2] = 16035981; tab[5][8][5][1] = 5713224; tab[5][8][6][0] = 779076; tab[5][8][0][7] = 1817844; tab[5][8][1][6] = 16620288; tab[5][8][2][5] = 59209776; tab[5][8][3][4] = 107317719; tab[5][8][4][3] = 107317719; tab[5][8][5][2] = 59209776; tab[5][8][6][1] = 16620288; tab[5][8][7][0] = 1817844; tab[5][8][0][8] = 3375996; tab[5][8][1][7] = 37915032; tab[5][8][2][6] = 167761032; tab[5][8][3][5] = 384863544; tab[5][8][4][4] = 503283096; tab[5][8][5][3] = 384863544; tab[5][8][6][2] = 167761032; tab[5][8][7][1] = 37915032; tab[5][8][8][0] = 3375996; tab[6][1][0][1] = 5; tab[6][1][1][0] = 5; tab[6][1][0][2] = 10; tab[6][1][1][1] = 20; tab[6][1][2][0] = 10; tab[6][1][0][3] = 5; tab[6][1][1][2] = 25; tab[6][1][2][1] = 25; tab[6][1][3][0] = 5; tab[6][1][0][4] = 0; tab[6][1][1][3] = 10; tab[6][1][2][2] = 20; tab[6][1][3][1] = 10; tab[6][1][4][0] = 0; tab[6][1][0][5] = 0; tab[6][1][1][4] = 0; tab[6][1][2][3] = 5; tab[6][1][3][2] = 5; tab[6][1][4][1] = 0; tab[6][1][5][0] = 0; tab[6][2][0][1] = 16; tab[6][2][1][0] = 16; tab[6][2][0][2] = 80; tab[6][2][1][1] = 160; tab[6][2][2][0] = 80; tab[6][2][0][3] = 160; tab[6][2][1][2] = 560; tab[6][2][2][1] = 560; tab[6][2][3][0] = 160; tab[6][2][0][4] = 160; tab[6][2][1][3] = 960; tab[6][2][2][2] = 1600; tab[6][2][3][1] = 960; tab[6][2][4][0] = 160; tab[6][2][0][5] = 80; tab[6][2][1][4] = 880; tab[6][2][2][3] = 2400; tab[6][2][3][2] = 2400; tab[6][2][4][1] = 880; tab[6][2][5][0] = 80; tab[6][2][0][6] = 16; tab[6][2][1][5] = 416; tab[6][2][2][4] = 2000; tab[6][2][3][3] = 3200; tab[6][2][4][2] = 2000; tab[6][2][5][1] = 416; tab[6][2][6][0] = 16; tab[6][2][0][7] = 0; tab[6][2][1][6] = 80; tab[6][2][2][5] = 880; tab[6][2][3][4] = 2400; tab[6][2][4][3] = 2400; tab[6][2][5][2] = 880; tab[6][2][6][1] = 80; tab[6][2][7][0] = 0; tab[6][2][0][8] = 0; tab[6][2][1][7] = 0; tab[6][2][2][6] = 160; tab[6][2][3][5] = 960; tab[6][2][4][4] = 1600; tab[6][2][5][3] = 960; tab[6][2][6][2] = 160; tab[6][2][7][1] = 0; tab[6][2][8][0] = 0; tab[6][3][0][1] = 27; tab[6][3][1][0] = 27; tab[6][3][0][2] = 216; tab[6][3][1][1] = 432; tab[6][3][2][0] = 216; tab[6][3][0][3] = 756; tab[6][3][1][2] = 2484; tab[6][3][2][1] = 2484; tab[6][3][3][0] = 756; tab[6][3][0][4] = 1512; tab[6][3][1][3] = 7560; tab[6][3][2][2] = 12096; tab[6][3][3][1] = 7560; tab[6][3][4][0] = 1512; tab[6][3][0][5] = 1890; tab[6][3][1][4] = 13986; tab[6][3][2][3] = 33264; tab[6][3][3][2] = 33264; tab[6][3][4][1] = 13986; tab[6][3][5][0] = 1890; tab[6][3][0][6] = 1512; tab[6][3][1][5] = 16632; tab[6][3][2][4] = 57456; tab[6][3][3][3] = 84672; tab[6][3][4][2] = 57456; tab[6][3][5][1] = 16632; tab[6][3][6][0] = 1512; tab[6][3][0][7] = 756; tab[6][3][1][6] = 12852; tab[6][3][2][5] = 65016; tab[6][3][3][4] = 137592; tab[6][3][4][3] = 137592; tab[6][3][5][2] = 65016; tab[6][3][6][1] = 12852; tab[6][3][7][0] = 756; tab[6][3][0][8] = 216; tab[6][3][1][7] = 6264; tab[6][3][2][6] = 48384; tab[6][3][3][5] = 148176; tab[6][3][4][4] = 211680; tab[6][3][5][3] = 148176; tab[6][3][6][2] = 48384; tab[6][3][7][1] = 6264; tab[6][3][8][0] = 216; tab[6][4][0][1] = 38; tab[6][4][1][0] = 38; tab[6][4][0][2] = 418; tab[6][4][1][1] = 836; tab[6][4][2][0] = 418; tab[6][4][0][3] = 2090; tab[6][4][1][2] = 6688; tab[6][4][2][1] = 6688; tab[6][4][3][0] = 2090; tab[6][4][0][4] = 6270; tab[6][4][1][3] = 29260; tab[6][4][2][2] = 45980; tab[6][4][3][1] = 29260; tab[6][4][4][0] = 6270; tab[6][4][0][5] = 12540; tab[6][4][1][4] = 81510; tab[6][4][2][3] = 183920; tab[6][4][3][2] = 183920; tab[6][4][4][1] = 81510; tab[6][4][5][0] = 12540; tab[6][4][0][6] = 17556; tab[6][4][1][5] = 155496; tab[6][4][2][4] = 482790; tab[6][4][3][3] = 689700; tab[6][4][4][2] = 482790; tab[6][4][5][1] = 155496; tab[6][4][6][0] = 17556; tab[6][4][0][7] = 17556; tab[6][4][1][6] = 210672; tab[6][4][2][5] = 882816; tab[6][4][3][4] = 1724250; tab[6][4][4][3] = 1724250; tab[6][4][5][2] = 882816; tab[6][4][6][1] = 210672; tab[6][4][7][0] = 17556; tab[6][4][0][8] = 12540; tab[6][4][1][7] = 205656; tab[6][4][2][6] = 1158696; tab[6][4][3][5] = 3034680; tab[6][4][4][4] = 4138200; tab[6][4][5][3] = 3034680; tab[6][4][6][2] = 1158696; tab[6][4][7][1] = 205656; tab[6][4][8][0] = 12540; tab[6][5][0][1] = 49; tab[6][5][1][0] = 49; tab[6][5][0][2] = 686; tab[6][5][1][1] = 1372; tab[6][5][2][0] = 686; tab[6][5][0][3] = 4459; tab[6][5][1][2] = 14063; tab[6][5][2][1] = 14063; tab[6][5][3][0] = 4459; tab[6][5][0][4] = 17836; tab[6][5][1][3] = 80262; tab[6][5][2][2] = 124852; tab[6][5][3][1] = 80262; tab[6][5][4][0] = 17836; tab[6][5][0][5] = 49049; tab[6][5][1][4] = 298753; tab[6][5][2][3] = 655473; tab[6][5][3][2] = 655473; tab[6][5][4][1] = 298753; tab[6][5][5][0] = 49049; tab[6][5][0][6] = 98098; tab[6][5][1][5] = 784784; tab[6][5][2][4] = 2309762; tab[6][5][3][3] = 3246152; tab[6][5][4][2] = 2309762; tab[6][5][5][1] = 784784; tab[6][5][6][0] = 98098; tab[6][5][0][7] = 147147; tab[6][5][1][6] = 1520519; tab[6][5][2][5] = 5836831; tab[6][5][3][4] = 10955763; tab[6][5][4][3] = 10955763; tab[6][5][5][2] = 5836831; tab[6][5][6][1] = 1520519; tab[6][5][7][0] = 147147; tab[6][5][0][8] = 168168; tab[6][5][1][7] = 2228226; tab[6][5][2][6] = 10986976; tab[6][5][3][5] = 26780754; tab[6][5][4][4] = 35707672; tab[6][5][5][3] = 26780754; tab[6][5][6][2] = 10986976; tab[6][5][7][1] = 2228226; tab[6][5][8][0] = 168168; tab[6][6][0][1] = 60; tab[6][6][1][0] = 60; tab[6][6][0][2] = 1020; tab[6][6][1][1] = 2040; tab[6][6][2][0] = 1020; tab[6][6][0][3] = 8160; tab[6][6][1][2] = 25500; tab[6][6][2][1] = 25500; tab[6][6][3][0] = 8160; tab[6][6][0][4] = 40800; tab[6][6][1][3] = 179520; tab[6][6][2][2] = 277440; tab[6][6][3][1] = 179520; tab[6][6][4][0] = 40800; tab[6][6][0][5] = 142800; tab[6][6][1][4] = 836400; tab[6][6][2][3] = 1803360; tab[6][6][3][2] = 1803360; tab[6][6][4][1] = 836400; tab[6][6][5][0] = 142800; tab[6][6][0][6] = 371280; tab[6][6][1][5] = 2798880; tab[6][6][2][4] = 7976400; tab[6][6][3][3] = 11097600; tab[6][6][4][2] = 7976400; tab[6][6][5][1] = 2798880; tab[6][6][6][0] = 371280; tab[6][6][0][7] = 742560; tab[6][6][1][6] = 7054320; tab[6][6][2][5] = 25732560; tab[6][6][3][4] = 47164800; tab[6][6][4][3] = 47164800; tab[6][6][5][2] = 25732560; tab[6][6][6][1] = 7054320; tab[6][6][7][0] = 742560; tab[6][6][0][8] = 1166880; tab[6][6][1][7] = 13790400; tab[6][6][2][6] = 63117600; tab[6][6][3][5] = 147598080; tab[6][6][4][4] = 194208000; tab[6][6][5][3] = 147598080; tab[6][6][6][2] = 63117600; tab[6][6][7][1] = 13790400; tab[6][6][8][0] = 1166880; tab[6][7][0][1] = 71; tab[6][7][1][0] = 71; tab[6][7][0][2] = 1420; tab[6][7][1][1] = 2840; tab[6][7][2][0] = 1420; tab[6][7][0][3] = 13490; tab[6][7][1][2] = 41890; tab[6][7][2][1] = 41890; tab[6][7][3][0] = 13490; tab[6][7][0][4] = 80940; tab[6][7][1][3] = 350740; tab[6][7][2][2] = 539600; tab[6][7][3][1] = 350740; tab[6][7][4][0] = 80940; tab[6][7][0][5] = 343995; tab[6][7][1][4] = 1962795; tab[6][7][2][3] = 4181900; tab[6][7][3][2] = 4181900; tab[6][7][4][1] = 1962795; tab[6][7][5][0] = 343995; tab[6][7][0][6] = 1100784; tab[6][7][1][5] = 7980684; tab[6][7][2][4] = 22258500; tab[6][7][3][3] = 30757200; tab[6][7][4][2] = 22258500; tab[6][7][5][1] = 7980684; tab[6][7][6][0] = 1100784; tab[6][7][0][7] = 2751960; tab[6][7][1][6] = 24767640; tab[6][7][2][5] = 87374730; tab[6][7][3][4] = 157630650; tab[6][7][4][3] = 157630650; tab[6][7][5][2] = 87374730; tab[6][7][6][1] = 24767640; tab[6][7][7][0] = 2751960; tab[6][7][0][8] = 5503920; tab[6][7][1][7] = 60543120; tab[6][7][2][6] = 264188160; tab[6][7][3][5] = 601303260; tab[6][7][4][4] = 784308600; tab[6][7][5][3] = 601303260; tab[6][7][6][2] = 264188160; tab[6][7][7][1] = 60543120; tab[6][7][8][0] = 5503920; tab[6][8][0][1] = 82; tab[6][8][1][0] = 82; tab[6][8][0][2] = 1886; tab[6][8][1][1] = 3772; tab[6][8][2][0] = 1886; tab[6][8][0][3] = 20746; tab[6][8][1][2] = 64124; tab[6][8][2][1] = 64124; tab[6][8][3][0] = 20746; tab[6][8][0][4] = 145222; tab[6][8][1][3] = 622380; tab[6][8][2][2] = 954316; tab[6][8][3][1] = 622380; tab[6][8][4][0] = 145222; tab[6][8][0][5] = 726110; tab[6][8][1][4] = 4066216; tab[6][8][2][3] = 8588844; tab[6][8][3][2] = 8588844; tab[6][8][4][1] = 4066216; tab[6][8][5][0] = 726110; tab[6][8][0][6] = 2759218; tab[6][8][1][5] = 19459748; tab[6][8][2][4] = 53441696; tab[6][8][3][3] = 73482332; tab[6][8][4][2] = 53441696; tab[6][8][5][1] = 19459748; tab[6][8][6][0] = 2759218; tab[6][8][0][7] = 8277654; tab[6][8][1][6] = 71739668; tab[6][8][2][5] = 247167844; tab[6][8][3][4] = 440893992; tab[6][8][4][3] = 440893992; tab[6][8][5][2] = 247167844; tab[6][8][6][1] = 71739668; tab[6][8][7][0] = 8277654; tab[6][8][0][8] = 20102874; tab[6][8][1][7] = 210488916; tab[6][8][2][6] = 888468196; tab[6][8][3][5] = 1984022964; tab[6][8][4][4] = 2571881620; tab[6][8][5][3] = 1984022964; tab[6][8][6][2] = 888468196; tab[6][8][7][1] = 210488916; tab[6][8][8][0] = 20102874; tab[7][1][0][1] = 6; tab[7][1][1][0] = 6; tab[7][1][0][2] = 12; tab[7][1][1][1] = 30; tab[7][1][2][0] = 18; tab[7][1][0][3] = 6; tab[7][1][1][2] = 42; tab[7][1][2][1] = 54; tab[7][1][3][0] = 18; tab[7][1][0][4] = 0; tab[7][1][1][3] = 18; tab[7][1][2][2] = 54; tab[7][1][3][1] = 42; tab[7][1][4][0] = 6; tab[7][1][0][5] = 0; tab[7][1][1][4] = 0; tab[7][1][2][3] = 18; tab[7][1][3][2] = 30; tab[7][1][4][1] = 12; tab[7][1][5][0] = 0; tab[7][1][0][6] = 0; tab[7][1][1][5] = 0; tab[7][1][2][4] = 0; tab[7][1][3][3] = 6; tab[7][1][4][2] = 6; tab[7][1][5][1] = 0; tab[7][1][6][0] = 0; tab[7][2][0][1] = 19; tab[7][2][1][0] = 19; tab[7][2][0][2] = 114; tab[7][2][1][1] = 228; tab[7][2][2][0] = 114; tab[7][2][0][3] = 285; tab[7][2][1][2] = 969; tab[7][2][2][1] = 969; tab[7][2][3][0] = 285; tab[7][2][0][4] = 380; tab[7][2][1][3] = 2090; tab[7][2][2][2] = 3420; tab[7][2][3][1] = 2090; tab[7][2][4][0] = 380; tab[7][2][0][5] = 285; tab[7][2][1][4] = 2565; tab[7][2][2][3] = 6555; tab[7][2][3][2] = 6555; tab[7][2][4][1] = 2565; tab[7][2][5][0] = 285; tab[7][2][0][6] = 114; tab[7][2][1][5] = 1824; tab[7][2][2][4] = 7410; tab[7][2][3][3] = 11400; tab[7][2][4][2] = 7410; tab[7][2][5][1] = 1824; tab[7][2][6][0] = 114; tab[7][2][0][7] = 19; tab[7][2][1][6] = 703; tab[7][2][2][5] = 4959; tab[7][2][3][4] = 11875; tab[7][2][4][3] = 11875; tab[7][2][5][2] = 4959; tab[7][2][6][1] = 703; tab[7][2][7][0] = 19; tab[7][2][0][8] = 0; tab[7][2][1][7] = 114; tab[7][2][2][6] = 1824; tab[7][2][3][5] = 7410; tab[7][2][4][4] = 11400; tab[7][2][5][3] = 7410; tab[7][2][6][2] = 1824; tab[7][2][7][1] = 114; tab[7][2][8][0] = 0; tab[7][3][0][1] = 32; tab[7][3][1][0] = 32; tab[7][3][0][2] = 288; tab[7][3][1][1] = 608; tab[7][3][2][0] = 320; tab[7][3][0][3] = 1152; tab[7][3][1][2] = 4032; tab[7][3][2][1] = 4320; tab[7][3][3][0] = 1440; tab[7][3][0][4] = 2688; tab[7][3][1][3] = 14208; tab[7][3][2][2] = 24480; tab[7][3][3][1] = 16800; tab[7][3][4][0] = 3840; tab[7][3][0][5] = 4032; tab[7][3][1][4] = 30912; tab[7][3][2][3] = 78720; tab[7][3][3][2] = 86400; tab[7][3][4][1] = 41280; tab[7][3][5][0] = 6720; tab[7][3][0][6] = 4032; tab[7][3][1][5] = 44352; tab[7][3][2][4] = 161280; tab[7][3][3][3] = 259200; tab[7][3][4][2] = 198720; tab[7][3][5][1] = 68544; tab[7][3][6][0] = 8064; tab[7][3][0][7] = 2688; tab[7][3][1][6] = 43008; tab[7][3][2][5] = 221760; tab[7][3][3][4] = 504000; tab[7][3][4][3] = 564480; tab[7][3][5][2] = 314496; tab[7][3][6][1] = 79296; tab[7][3][7][0] = 6720; tab[7][3][0][8] = 1152; tab[7][3][1][7] = 28032; tab[7][3][2][6] = 208320; tab[7][3][3][5] = 665280; tab[7][3][4][4] = 1048320; tab[7][3][5][3] = 854784; tab[7][3][6][2] = 350784; tab[7][3][7][1] = 64320; tab[7][3][8][0] = 3840; tab[7][4][0][1] = 45; tab[7][4][1][0] = 45; tab[7][4][0][2] = 585; tab[7][4][1][1] = 1170; tab[7][4][2][0] = 585; tab[7][4][0][3] = 3510; tab[7][4][1][2] = 11115; tab[7][4][2][1] = 11115; tab[7][4][3][0] = 3510; tab[7][4][0][4] = 12870; tab[7][4][1][3] = 58500; tab[7][4][2][2] = 91260; tab[7][4][3][1] = 58500; tab[7][4][4][0] = 12870; tab[7][4][0][5] = 32175; tab[7][4][1][4] = 199485; tab[7][4][2][3] = 441090; tab[7][4][3][2] = 441090; tab[7][4][4][1] = 199485; tab[7][4][5][0] = 32175; tab[7][4][0][6] = 57915; tab[7][4][1][5] = 476190; tab[7][4][2][4] = 1422135; tab[7][4][3][3] = 2007720; tab[7][4][4][2] = 1422135; tab[7][4][5][1] = 476190; tab[7][4][6][0] = 57915; tab[7][4][0][7] = 77220; tab[7][4][1][6] = 830115; tab[7][4][2][5] = 3262545; tab[7][4][3][4] = 6190470; tab[7][4][4][3] = 6190470; tab[7][4][5][2] = 3262545; tab[7][4][6][1] = 830115; tab[7][4][7][0] = 77220; tab[7][4][0][8] = 77220; tab[7][4][1][7] = 1081080; tab[7][4][2][6] = 5521230; tab[7][4][3][5] = 13719420; tab[7][4][4][4] = 18404100; tab[7][4][5][3] = 13719420; tab[7][4][6][2] = 5521230; tab[7][4][7][1] = 1081080; tab[7][4][8][0] = 77220; tab[7][5][0][1] = 58; tab[7][5][1][0] = 58; tab[7][5][0][2] = 928; tab[7][5][1][1] = 1914; tab[7][5][2][0] = 986; tab[7][5][0][3] = 6960; tab[7][5][1][2] = 22736; tab[7][5][2][1] = 23664; tab[7][5][3][0] = 7888; tab[7][5][0][4] = 32480; tab[7][5][1][3] = 150800; tab[7][5][2][2] = 244528; tab[7][5][3][1] = 165648; tab[7][5][4][0] = 39440; tab[7][5][0][5] = 105560; tab[7][5][1][4] = 657720; tab[7][5][2][3] = 1498720; tab[7][5][3][2] = 1577600; tab[7][5][4][1] = 769080; tab[7][5][5][0] = 138040; tab[7][5][0][6] = 253344; tab[7][5][1][5] = 2047864; tab[7][5][2][4] = 6211800; tab[7][5][3][3] = 9150080; tab[7][5][4][2] = 6941440; tab[7][5][5][1] = 2567544; tab[7][5][6][0] = 358904; tab[7][5][0][7] = 464464; tab[7][5][1][6] = 4771312; tab[7][5][2][5] = 18663008; tab[7][5][3][4] = 36442560; tab[7][5][4][3] = 38651200; tab[7][5][5][2] = 22307264; tab[7][5][6][1] = 6460272; tab[7][5][7][0] = 717808; tab[7][5][0][8] = 663520; tab[7][5][1][7] = 8559408; tab[7][5][2][6] = 42350672; tab[7][5][3][5] = 106235584; tab[7][5][4][4] = 149083200; tab[7][5][5][3] = 120370880; tab[7][5][6][2] = 54553408; tab[7][5][7][1] = 12612912; tab[7][5][8][0] = 1127984; tab[7][6][0][1] = 71; tab[7][6][1][0] = 71; tab[7][6][0][2] = 1420; tab[7][6][1][1] = 2840; tab[7][6][2][0] = 1420; tab[7][6][0][3] = 13490; tab[7][6][1][2] = 41890; tab[7][6][2][1] = 41890; tab[7][6][3][0] = 13490; tab[7][6][0][4] = 80940; tab[7][6][1][3] = 350740; tab[7][6][2][2] = 539600; tab[7][6][3][1] = 350740; tab[7][6][4][0] = 80940; tab[7][6][0][5] = 343995; tab[7][6][1][4] = 1962795; tab[7][6][2][3] = 4181900; tab[7][6][3][2] = 4181900; tab[7][6][4][1] = 1962795; tab[7][6][5][0] = 343995; tab[7][6][0][6] = 1100784; tab[7][6][1][5] = 7980684; tab[7][6][2][4] = 22258500; tab[7][6][3][3] = 30757200; tab[7][6][4][2] = 22258500; tab[7][6][5][1] = 7980684; tab[7][6][6][0] = 1100784; tab[7][6][0][7] = 2751960; tab[7][6][1][6] = 24767640; tab[7][6][2][5] = 87374730; tab[7][6][3][4] = 157630650; tab[7][6][4][3] = 157630650; tab[7][6][5][2] = 87374730; tab[7][6][6][1] = 24767640; tab[7][6][7][0] = 2751960; tab[7][6][0][8] = 5503920; tab[7][6][1][7] = 60543120; tab[7][6][2][6] = 264188160; tab[7][6][3][5] = 601303260; tab[7][6][4][4] = 784308600; tab[7][6][5][3] = 601303260; tab[7][6][6][2] = 264188160; tab[7][6][7][1] = 60543120; tab[7][6][8][0] = 5503920; tab[7][7][0][1] = 84; tab[7][7][1][0] = 84; tab[7][7][0][2] = 1932; tab[7][7][1][1] = 3948; tab[7][7][2][0] = 2016; tab[7][7][0][3] = 21252; tab[7][7][1][2] = 67620; tab[7][7][2][1] = 69552; tab[7][7][3][0] = 23184; tab[7][7][0][4] = 148764; tab[7][7][1][3] = 658812; tab[7][7][2][2] = 1043280; tab[7][7][3][1] = 703248; tab[7][7][4][0] = 170016; tab[7][7][0][5] = 743820; tab[7][7][1][4] = 4314156; tab[7][7][2][3] = 9435888; tab[7][7][3][2] = 9775920; tab[7][7][4][1] = 4802952; tab[7][7][5][0] = 892584; tab[7][7][0][6] = 2826516; tab[7][7][1][5] = 20678196; tab[7][7][2][4] = 58910544; tab[7][7][3][3] = 84072912; tab[7][7][4][2] = 63543480; tab[7][7][5][1] = 24099768; tab[7][7][6][0] = 3570336; tab[7][7][0][7] = 8479548; tab[7][7][1][6] = 76315932; tab[7][7][2][5] = 273130704; tab[7][7][3][4] = 506392656; tab[7][7][4][3] = 526922088; tab[7][7][5][2] = 307941480; tab[7][7][6][1] = 93423792; tab[7][7][7][0] = 11306064; tab[7][7][0][8] = 20593188; tab[7][7][1][7] = 224102340; tab[7][7][2][6] = 983627568; tab[7][7][3][5] = 2285610096; tab[7][7][4][4] = 3086257944; tab[7][7][5][3] = 2484061272; tab[7][7][6][2] = 1163334480; tab[7][7][7][1] = 289112208; tab[7][7][8][0] = 29072736; tab[7][8][0][1] = 97; tab[7][8][1][0] = 97; tab[7][8][0][2] = 2619; tab[7][8][1][1] = 5238; tab[7][8][2][0] = 2619; tab[7][8][0][3] = 34047; tab[7][8][1][2] = 104760; tab[7][8][2][1] = 104760; tab[7][8][3][0] = 34047; tab[7][8][0][4] = 283725; tab[7][8][1][3] = 1202994; tab[7][8][2][2] = 1838538; tab[7][8][3][1] = 1202994; tab[7][8][4][0] = 283725; tab[7][8][0][5] = 1702350; tab[7][8][1][4] = 9362925; tab[7][8][2][3] = 19611072; tab[7][8][3][2] = 19611072; tab[7][8][4][1] = 9362925; tab[7][8][5][0] = 1702350; tab[7][8][0][6] = 7830810; tab[7][8][1][5] = 53794260; tab[7][8][2][4] = 145550925; tab[7][8][3][3] = 199174950; tab[7][8][4][2] = 145550925; tab[7][8][5][1] = 53794260; tab[7][8][6][0] = 7830810; tab[7][8][0][7] = 28712970; tab[7][8][1][6] = 240144840; tab[7][8][2][5] = 808956720; tab[7][8][3][4] = 1427420475; tab[7][8][4][3] = 1427420475; tab[7][8][5][2] = 808956720; tab[7][8][6][1] = 240144840; tab[7][8][7][0] = 28712970; tab[7][8][0][8] = 86138910; tab[7][8][1][7] = 861389100; tab[7][8][2][6] = 3523864500; tab[7][8][3][5] = 7727988060; tab[7][8][4][4] = 9958747500; tab[7][8][5][3] = 7727988060; tab[7][8][6][2] = 3523864500; tab[7][8][7][1] = 861389100; tab[7][8][8][0] = 86138910; tab[8][1][0][1] = 7; tab[8][1][1][0] = 7; tab[8][1][0][2] = 21; tab[8][1][1][1] = 42; tab[8][1][2][0] = 21; tab[8][1][0][3] = 21; tab[8][1][1][2] = 84; tab[8][1][2][1] = 84; tab[8][1][3][0] = 21; tab[8][1][0][4] = 7; tab[8][1][1][3] = 70; tab[8][1][2][2] = 126; tab[8][1][3][1] = 70; tab[8][1][4][0] = 7; tab[8][1][0][5] = 0; tab[8][1][1][4] = 21; tab[8][1][2][3] = 84; tab[8][1][3][2] = 84; tab[8][1][4][1] = 21; tab[8][1][5][0] = 0; tab[8][1][0][6] = 0; tab[8][1][1][5] = 0; tab[8][1][2][4] = 21; tab[8][1][3][3] = 42; tab[8][1][4][2] = 21; tab[8][1][5][1] = 0; tab[8][1][6][0] = 0; tab[8][1][0][7] = 0; tab[8][1][1][6] = 0; tab[8][1][2][5] = 0; tab[8][1][3][4] = 7; tab[8][1][4][3] = 7; tab[8][1][5][2] = 0; tab[8][1][6][1] = 0; tab[8][1][7][0] = 0; tab[8][2][0][1] = 22; tab[8][2][1][0] = 22; tab[8][2][0][2] = 154; tab[8][2][1][1] = 308; tab[8][2][2][0] = 154; tab[8][2][0][3] = 462; tab[8][2][1][2] = 1540; tab[8][2][2][1] = 1540; tab[8][2][3][0] = 462; tab[8][2][0][4] = 770; tab[8][2][1][3] = 4004; tab[8][2][2][2] = 6468; tab[8][2][3][1] = 4004; tab[8][2][4][0] = 770; tab[8][2][0][5] = 770; tab[8][2][1][4] = 6160; tab[8][2][2][3] = 15092; tab[8][2][3][2] = 15092; tab[8][2][4][1] = 6160; tab[8][2][5][0] = 770; tab[8][2][0][6] = 462; tab[8][2][1][5] = 5852; tab[8][2][2][4] = 21560; tab[8][2][3][3] = 32340; tab[8][2][4][2] = 21560; tab[8][2][5][1] = 5852; tab[8][2][6][0] = 462; tab[8][2][0][7] = 154; tab[8][2][1][6] = 3388; tab[8][2][2][5] = 19404; tab[8][2][3][4] = 43120; tab[8][2][4][3] = 43120; tab[8][2][5][2] = 19404; tab[8][2][6][1] = 3388; tab[8][2][7][0] = 154; tab[8][2][0][8] = 22; tab[8][2][1][7] = 1100; tab[8][2][2][6] = 10780; tab[8][2][3][5] = 36652; tab[8][2][4][4] = 53900; tab[8][2][5][3] = 36652; tab[8][2][6][2] = 10780; tab[8][2][7][1] = 1100; tab[8][2][8][0] = 22; tab[8][3][0][1] = 37; tab[8][3][1][0] = 37; tab[8][3][0][2] = 407; tab[8][3][1][1] = 814; tab[8][3][2][0] = 407; tab[8][3][0][3] = 2035; tab[8][3][1][2] = 6512; tab[8][3][2][1] = 6512; tab[8][3][3][0] = 2035; tab[8][3][0][4] = 6105; tab[8][3][1][3] = 28490; tab[8][3][2][2] = 44770; tab[8][3][3][1] = 28490; tab[8][3][4][0] = 6105; tab[8][3][0][5] = 12210; tab[8][3][1][4] = 79365; tab[8][3][2][3] = 179080; tab[8][3][3][2] = 179080; tab[8][3][4][1] = 79365; tab[8][3][5][0] = 12210; tab[8][3][0][6] = 17094; tab[8][3][1][5] = 151404; tab[8][3][2][4] = 470085; tab[8][3][3][3] = 671550; tab[8][3][4][2] = 470085; tab[8][3][5][1] = 151404; tab[8][3][6][0] = 17094; tab[8][3][0][7] = 17094; tab[8][3][1][6] = 205128; tab[8][3][2][5] = 859584; tab[8][3][3][4] = 1678875; tab[8][3][4][3] = 1678875; tab[8][3][5][2] = 859584; tab[8][3][6][1] = 205128; tab[8][3][7][0] = 17094; tab[8][3][0][8] = 12210; tab[8][3][1][7] = 200244; tab[8][3][2][6] = 1128204; tab[8][3][3][5] = 2954820; tab[8][3][4][4] = 4029300; tab[8][3][5][3] = 2954820; tab[8][3][6][2] = 1128204; tab[8][3][7][1] = 200244; tab[8][3][8][0] = 12210; tab[8][4][0][1] = 52; tab[8][4][1][0] = 52; tab[8][4][0][2] = 780; tab[8][4][1][1] = 1560; tab[8][4][2][0] = 780; tab[8][4][0][3] = 5460; tab[8][4][1][2] = 17160; tab[8][4][2][1] = 17160; tab[8][4][3][0] = 5460; tab[8][4][0][4] = 23660; tab[8][4][1][3] = 105560; tab[8][4][2][2] = 163800; tab[8][4][3][1] = 105560; tab[8][4][4][0] = 23660; tab[8][4][0][5] = 70980; tab[8][4][1][4] = 425880; tab[8][4][2][3] = 928200; tab[8][4][3][2] = 928200; tab[8][4][4][1] = 425880; tab[8][4][5][0] = 70980; tab[8][4][0][6] = 156156; tab[8][4][1][5] = 1220856; tab[8][4][2][4] = 3549000; tab[8][4][3][3] = 4968600; tab[8][4][4][2] = 3549000; tab[8][4][5][1] = 1220856; tab[8][4][6][0] = 156156; tab[8][4][0][7] = 260260; tab[8][4][1][6] = 2602600; tab[8][4][2][5] = 9795240; tab[8][4][3][4] = 18218200; tab[8][4][4][3] = 18218200; tab[8][4][5][2] = 9795240; tab[8][4][6][1] = 2602600; tab[8][4][7][0] = 260260; tab[8][4][0][8] = 334620; tab[8][4][1][7] = 4238520; tab[8][4][2][6] = 20300280; tab[8][4][3][5] = 48692280; tab[8][4][4][4] = 64591800; tab[8][4][5][3] = 48692280; tab[8][4][6][2] = 20300280; tab[8][4][7][1] = 4238520; tab[8][4][8][0] = 334620; tab[8][5][0][1] = 67; tab[8][5][1][0] = 67; tab[8][5][0][2] = 1273; tab[8][5][1][1] = 2546; tab[8][5][2][0] = 1273; tab[8][5][0][3] = 11457; tab[8][5][1][2] = 35644; tab[8][5][2][1] = 35644; tab[8][5][3][0] = 11457; tab[8][5][0][4] = 64923; tab[8][5][1][3] = 282606; tab[8][5][2][2] = 435366; tab[8][5][3][1] = 282606; tab[8][5][4][0] = 64923; tab[8][5][0][5] = 259692; tab[8][5][1][4] = 1493229; tab[8][5][2][3] = 3192684; tab[8][5][3][2] = 3192684; tab[8][5][4][1] = 1493229; tab[8][5][5][0] = 259692; tab[8][5][0][6] = 779076; tab[8][5][1][5] = 5713224; tab[8][5][2][4] = 16035981; tab[8][5][3][3] = 22203666; tab[8][5][4][2] = 16035981; tab[8][5][5][1] = 5713224; tab[8][5][6][0] = 779076; tab[8][5][0][7] = 1817844; tab[8][5][1][6] = 16620288; tab[8][5][2][5] = 59209776; tab[8][5][3][4] = 107317719; tab[8][5][4][3] = 107317719; tab[8][5][5][2] = 59209776; tab[8][5][6][1] = 16620288; tab[8][5][7][0] = 1817844; tab[8][5][0][8] = 3375996; tab[8][5][1][7] = 37915032; tab[8][5][2][6] = 167761032; tab[8][5][3][5] = 384863544; tab[8][5][4][4] = 503283096; tab[8][5][5][3] = 384863544; tab[8][5][6][2] = 167761032; tab[8][5][7][1] = 37915032; tab[8][5][8][0] = 3375996; tab[8][6][0][1] = 82; tab[8][6][1][0] = 82; tab[8][6][0][2] = 1886; tab[8][6][1][1] = 3772; tab[8][6][2][0] = 1886; tab[8][6][0][3] = 20746; tab[8][6][1][2] = 64124; tab[8][6][2][1] = 64124; tab[8][6][3][0] = 20746; tab[8][6][0][4] = 145222; tab[8][6][1][3] = 622380; tab[8][6][2][2] = 954316; tab[8][6][3][1] = 622380; tab[8][6][4][0] = 145222; tab[8][6][0][5] = 726110; tab[8][6][1][4] = 4066216; tab[8][6][2][3] = 8588844; tab[8][6][3][2] = 8588844; tab[8][6][4][1] = 4066216; tab[8][6][5][0] = 726110; tab[8][6][0][6] = 2759218; tab[8][6][1][5] = 19459748; tab[8][6][2][4] = 53441696; tab[8][6][3][3] = 73482332; tab[8][6][4][2] = 53441696; tab[8][6][5][1] = 19459748; tab[8][6][6][0] = 2759218; tab[8][6][0][7] = 8277654; tab[8][6][1][6] = 71739668; tab[8][6][2][5] = 247167844; tab[8][6][3][4] = 440893992; tab[8][6][4][3] = 440893992; tab[8][6][5][2] = 247167844; tab[8][6][6][1] = 71739668; tab[8][6][7][0] = 8277654; tab[8][6][0][8] = 20102874; tab[8][6][1][7] = 210488916; tab[8][6][2][6] = 888468196; tab[8][6][3][5] = 1984022964; tab[8][6][4][4] = 2571881620; tab[8][6][5][3] = 1984022964; tab[8][6][6][2] = 888468196; tab[8][6][7][1] = 210488916; tab[8][6][8][0] = 20102874; tab[8][7][0][1] = 97; tab[8][7][1][0] = 97; tab[8][7][0][2] = 2619; tab[8][7][1][1] = 5238; tab[8][7][2][0] = 2619; tab[8][7][0][3] = 34047; tab[8][7][1][2] = 104760; tab[8][7][2][1] = 104760; tab[8][7][3][0] = 34047; tab[8][7][0][4] = 283725; tab[8][7][1][3] = 1202994; tab[8][7][2][2] = 1838538; tab[8][7][3][1] = 1202994; tab[8][7][4][0] = 283725; tab[8][7][0][5] = 1702350; tab[8][7][1][4] = 9362925; tab[8][7][2][3] = 19611072; tab[8][7][3][2] = 19611072; tab[8][7][4][1] = 9362925; tab[8][7][5][0] = 1702350; tab[8][7][0][6] = 7830810; tab[8][7][1][5] = 53794260; tab[8][7][2][4] = 145550925; tab[8][7][3][3] = 199174950; tab[8][7][4][2] = 145550925; tab[8][7][5][1] = 53794260; tab[8][7][6][0] = 7830810; tab[8][7][0][7] = 28712970; tab[8][7][1][6] = 240144840; tab[8][7][2][5] = 808956720; tab[8][7][3][4] = 1427420475; tab[8][7][4][3] = 1427420475; tab[8][7][5][2] = 808956720; tab[8][7][6][1] = 240144840; tab[8][7][7][0] = 28712970; tab[8][7][0][8] = 86138910; tab[8][7][1][7] = 861389100; tab[8][7][2][6] = 3523864500; tab[8][7][3][5] = 7727988060; tab[8][7][4][4] = 9958747500; tab[8][7][5][3] = 7727988060; tab[8][7][6][2] = 3523864500; tab[8][7][7][1] = 861389100; tab[8][7][8][0] = 86138910; tab[8][8][0][1] = 112; tab[8][8][1][0] = 112; tab[8][8][0][2] = 3472; tab[8][8][1][1] = 6944; tab[8][8][2][0] = 3472; tab[8][8][0][3] = 52080; tab[8][8][1][2] = 159712; tab[8][8][2][1] = 159712; tab[8][8][3][0] = 52080; tab[8][8][0][4] = 503440; tab[8][8][1][3] = 2117920; tab[8][8][2][2] = 3228960; tab[8][8][3][1] = 2117920; tab[8][8][4][0] = 503440; tab[8][8][0][5] = 3524080; tab[8][8][1][4] = 19130720; tab[8][8][2][3] = 39823840; tab[8][8][3][2] = 39823840; tab[8][8][4][1] = 19130720; tab[8][8][5][0] = 3524080; tab[8][8][0][6] = 19030032; tab[8][8][1][5] = 128276512; tab[8][8][2][4] = 343346080; tab[8][8][3][3] = 468199200; tab[8][8][4][2] = 343346080; tab[8][8][5][1] = 128276512; tab[8][8][6][0] = 19030032; tab[8][8][0][7] = 82463472; tab[8][8][1][6] = 672394464; tab[8][8][2][5] = 2228628192; tab[8][8][3][4] = 3901660000; tab[8][8][4][3] = 3901660000; tab[8][8][5][2] = 2228628192; tab[8][8][6][1] = 672394464; tab[8][8][7][0] = 82463472; tab[8][8][0][8] = 294512400; tab[8][8][1][7] = 2850880032; tab[8][8][2][6] = 11405332512; tab[8][8][3][5] = 24689704480; tab[8][8][4][4] = 31681479200; tab[8][8][5][3] = 24689704480; tab[8][8][6][2] = 11405332512; tab[8][8][7][1] = 2850880032; tab[8][8][8][0] = 294512400; } void compute() { if(cnt[0] % 2 != parity[0] % 2) { ans(0); return; } preproc(); w = 0; par = cnt[0] % 2; for(int q = par; q <= kk; q += 2) { w += tab[n][m][q][kk - q]; } good = 0; f(i, n) { f(j, m) { if(board[i][j]) { if(i > 0 && !board[i - 1][j]) { good++; } if(i < n - 1 && !board[i + 1][j]) { good++; } if(j > 0 && !board[i][j - 1]) { good++; } if(j < m - 1 && !board[i][j + 1]) { good++; } } } } long double goodLD = ((long double)(good)); long double wLD = ((long double)(w)); printf("%.15Lf\n", (goodLD / wLD)); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 | #include <bits/stdc++.h> #define INF 2147483647 #define LINF 9223372036854775807 #define NINF -2147483648 #define NLINF -9223372036854775808 #define M 1000000007 #define M1 998244353 #define A 26 #define P 2137 using namespace std; using db=double; using dbl=long double; using ll=long long; using pi=pair<int,int>; using pl=pair<ll,ll>; using vi=vector<int>; using vl=vector<ll>; using gr=vector<vector<int> >; using grl=vector<vector<ll> >; #define fp(x, a, b) for (int (x) = (a); (x) < (b); (x)++) #define f(x, n) for (int (x) = 0; (x) < (n); (x)++) #define fnp(x, a, b) for (int (x) = (b) - 1; (x) >= (a); (x)--) #define fn(x, n) for (int (x) = (n - 1); (x) >= 0; (x)--) #define sgn(x) (x) > 0 ? 1 : (x) == 0 ? 0 : -1 #define gcd(a, b) __gcd((a), (b)) #define lcm(a, b) (a) * (b) / gcd((a), (b)) #define x first #define y second #define mp make_pair #define pb push_back #define s(x) x.size() #define all(x) x.begin(), x.end() #define ans(x) cout<<(x)<<"\n" #define yes cout<<"YES\n"; #define no cout<<"NO\n"; #define fl cout.flush() #define debarr(x, n) f(i, (n)){cout<<(x)[i]<<" ";}cout<<"\n" #define debgr(x, n) f(i, (n)){f(j, s((x)[i])){cout<<(x)[i][j]<<" ";}cout<<"\n";} mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count()); void input(); void compute(); int main() { int T = 1; //cin >> T; while(T--) { input(); compute(); } return 0; } int n; int m; int kk; int cnt[2]; int parity[2]; int par; ll w; ll good; bool board[8][8]; ll tab[9][9][9][9]; void input() { string tmp; cin >> n >> m; kk = 0; cnt[0] = cnt[1] = 0; par = 0; parity[0] = parity[1] = 0; w = good = 0; f(i, 8) { f(j, 8) { board[i][j] = false; } } f(i, n) { cin >> tmp; f(j, m) { if(tmp[j] == 'O') { cnt[(i + j) % 2]++; kk++; } } } f(i, n) { cin >> tmp; f(j, m) { if(tmp[j] == 'O') { board[i][j] = true; parity[(i + j) % 2]++; } } } } void preproc() { tab[1][2][0][1] = 1; tab[1][2][1][0] = 1; tab[1][3][0][1] = 2; tab[1][3][1][0] = 2; tab[1][3][0][2] = 0; tab[1][3][1][1] = 2; tab[1][3][2][0] = 2; tab[1][4][0][1] = 3; tab[1][4][1][0] = 3; tab[1][4][0][2] = 3; tab[1][4][1][1] = 6; tab[1][4][2][0] = 3; tab[1][4][0][3] = 0; tab[1][4][1][2] = 3; tab[1][4][2][1] = 3; tab[1][4][3][0] = 0; tab[1][5][0][1] = 4; tab[1][5][1][0] = 4; tab[1][5][0][2] = 4; tab[1][5][1][1] = 12; tab[1][5][2][0] = 8; tab[1][5][0][3] = 0; tab[1][5][1][2] = 8; tab[1][5][2][1] = 12; tab[1][5][3][0] = 4; tab[1][5][0][4] = 0; tab[1][5][1][3] = 0; tab[1][5][2][2] = 4; tab[1][5][3][1] = 4; tab[1][5][4][0] = 0; tab[1][6][0][1] = 5; tab[1][6][1][0] = 5; tab[1][6][0][2] = 10; tab[1][6][1][1] = 20; tab[1][6][2][0] = 10; tab[1][6][0][3] = 5; tab[1][6][1][2] = 25; tab[1][6][2][1] = 25; tab[1][6][3][0] = 5; tab[1][6][0][4] = 0; tab[1][6][1][3] = 10; tab[1][6][2][2] = 20; tab[1][6][3][1] = 10; tab[1][6][4][0] = 0; tab[1][6][0][5] = 0; tab[1][6][1][4] = 0; tab[1][6][2][3] = 5; tab[1][6][3][2] = 5; tab[1][6][4][1] = 0; tab[1][6][5][0] = 0; tab[1][7][0][1] = 6; tab[1][7][1][0] = 6; tab[1][7][0][2] = 12; tab[1][7][1][1] = 30; tab[1][7][2][0] = 18; tab[1][7][0][3] = 6; tab[1][7][1][2] = 42; tab[1][7][2][1] = 54; tab[1][7][3][0] = 18; tab[1][7][0][4] = 0; tab[1][7][1][3] = 18; tab[1][7][2][2] = 54; tab[1][7][3][1] = 42; tab[1][7][4][0] = 6; tab[1][7][0][5] = 0; tab[1][7][1][4] = 0; tab[1][7][2][3] = 18; tab[1][7][3][2] = 30; tab[1][7][4][1] = 12; tab[1][7][5][0] = 0; tab[1][7][0][6] = 0; tab[1][7][1][5] = 0; tab[1][7][2][4] = 0; tab[1][7][3][3] = 6; tab[1][7][4][2] = 6; tab[1][7][5][1] = 0; tab[1][7][6][0] = 0; tab[1][8][0][1] = 7; tab[1][8][1][0] = 7; tab[1][8][0][2] = 21; tab[1][8][1][1] = 42; tab[1][8][2][0] = 21; tab[1][8][0][3] = 21; tab[1][8][1][2] = 84; tab[1][8][2][1] = 84; tab[1][8][3][0] = 21; tab[1][8][0][4] = 7; tab[1][8][1][3] = 70; tab[1][8][2][2] = 126; tab[1][8][3][1] = 70; tab[1][8][4][0] = 7; tab[1][8][0][5] = 0; tab[1][8][1][4] = 21; tab[1][8][2][3] = 84; tab[1][8][3][2] = 84; tab[1][8][4][1] = 21; tab[1][8][5][0] = 0; tab[1][8][0][6] = 0; tab[1][8][1][5] = 0; tab[1][8][2][4] = 21; tab[1][8][3][3] = 42; tab[1][8][4][2] = 21; tab[1][8][5][1] = 0; tab[1][8][6][0] = 0; tab[1][8][0][7] = 0; tab[1][8][1][6] = 0; tab[1][8][2][5] = 0; tab[1][8][3][4] = 7; tab[1][8][4][3] = 7; tab[1][8][5][2] = 0; tab[1][8][6][1] = 0; tab[1][8][7][0] = 0; tab[2][1][0][1] = 1; tab[2][1][1][0] = 1; tab[2][2][0][1] = 4; tab[2][2][1][0] = 4; tab[2][2][0][2] = 4; tab[2][2][1][1] = 8; tab[2][2][2][0] = 4; tab[2][2][0][3] = 0; tab[2][2][1][2] = 4; tab[2][2][2][1] = 4; tab[2][2][3][0] = 0; tab[2][3][0][1] = 7; tab[2][3][1][0] = 7; tab[2][3][0][2] = 14; tab[2][3][1][1] = 28; tab[2][3][2][0] = 14; tab[2][3][0][3] = 7; tab[2][3][1][2] = 35; tab[2][3][2][1] = 35; tab[2][3][3][0] = 7; tab[2][3][0][4] = 0; tab[2][3][1][3] = 14; tab[2][3][2][2] = 28; tab[2][3][3][1] = 14; tab[2][3][4][0] = 0; tab[2][3][0][5] = 0; tab[2][3][1][4] = 0; tab[2][3][2][3] = 7; tab[2][3][3][2] = 7; tab[2][3][4][1] = 0; tab[2][3][5][0] = 0; tab[2][4][0][1] = 10; tab[2][4][1][0] = 10; tab[2][4][0][2] = 30; tab[2][4][1][1] = 60; tab[2][4][2][0] = 30; tab[2][4][0][3] = 30; tab[2][4][1][2] = 120; tab[2][4][2][1] = 120; tab[2][4][3][0] = 30; tab[2][4][0][4] = 10; tab[2][4][1][3] = 100; tab[2][4][2][2] = 180; tab[2][4][3][1] = 100; tab[2][4][4][0] = 10; tab[2][4][0][5] = 0; tab[2][4][1][4] = 30; tab[2][4][2][3] = 120; tab[2][4][3][2] = 120; tab[2][4][4][1] = 30; tab[2][4][5][0] = 0; tab[2][4][0][6] = 0; tab[2][4][1][5] = 0; tab[2][4][2][4] = 30; tab[2][4][3][3] = 60; tab[2][4][4][2] = 30; tab[2][4][5][1] = 0; tab[2][4][6][0] = 0; tab[2][4][0][7] = 0; tab[2][4][1][6] = 0; tab[2][4][2][5] = 0; tab[2][4][3][4] = 10; tab[2][4][4][3] = 10; tab[2][4][5][2] = 0; tab[2][4][6][1] = 0; tab[2][4][7][0] = 0; tab[2][5][0][1] = 13; tab[2][5][1][0] = 13; tab[2][5][0][2] = 52; tab[2][5][1][1] = 104; tab[2][5][2][0] = 52; tab[2][5][0][3] = 78; tab[2][5][1][2] = 286; tab[2][5][2][1] = 286; tab[2][5][3][0] = 78; tab[2][5][0][4] = 52; tab[2][5][1][3] = 364; tab[2][5][2][2] = 624; tab[2][5][3][1] = 364; tab[2][5][4][0] = 52; tab[2][5][0][5] = 13; tab[2][5][1][4] = 221; tab[2][5][2][3] = 676; tab[2][5][3][2] = 676; tab[2][5][4][1] = 221; tab[2][5][5][0] = 13; tab[2][5][0][6] = 0; tab[2][5][1][5] = 52; tab[2][5][2][4] = 364; tab[2][5][3][3] = 624; tab[2][5][4][2] = 364; tab[2][5][5][1] = 52; tab[2][5][6][0] = 0; tab[2][5][0][7] = 0; tab[2][5][1][6] = 0; tab[2][5][2][5] = 78; tab[2][5][3][4] = 286; tab[2][5][4][3] = 286; tab[2][5][5][2] = 78; tab[2][5][6][1] = 0; tab[2][5][7][0] = 0; tab[2][5][0][8] = 0; tab[2][5][1][7] = 0; tab[2][5][2][6] = 0; tab[2][5][3][5] = 52; tab[2][5][4][4] = 104; tab[2][5][5][3] = 52; tab[2][5][6][2] = 0; tab[2][5][7][1] = 0; tab[2][5][8][0] = 0; tab[2][6][0][1] = 16; tab[2][6][1][0] = 16; tab[2][6][0][2] = 80; tab[2][6][1][1] = 160; tab[2][6][2][0] = 80; tab[2][6][0][3] = 160; tab[2][6][1][2] = 560; tab[2][6][2][1] = 560; tab[2][6][3][0] = 160; tab[2][6][0][4] = 160; tab[2][6][1][3] = 960; tab[2][6][2][2] = 1600; tab[2][6][3][1] = 960; tab[2][6][4][0] = 160; tab[2][6][0][5] = 80; tab[2][6][1][4] = 880; tab[2][6][2][3] = 2400; tab[2][6][3][2] = 2400; tab[2][6][4][1] = 880; tab[2][6][5][0] = 80; tab[2][6][0][6] = 16; tab[2][6][1][5] = 416; tab[2][6][2][4] = 2000; tab[2][6][3][3] = 3200; tab[2][6][4][2] = 2000; tab[2][6][5][1] = 416; tab[2][6][6][0] = 16; tab[2][6][0][7] = 0; tab[2][6][1][6] = 80; tab[2][6][2][5] = 880; tab[2][6][3][4] = 2400; tab[2][6][4][3] = 2400; tab[2][6][5][2] = 880; tab[2][6][6][1] = 80; tab[2][6][7][0] = 0; tab[2][6][0][8] = 0; tab[2][6][1][7] = 0; tab[2][6][2][6] = 160; tab[2][6][3][5] = 960; tab[2][6][4][4] = 1600; tab[2][6][5][3] = 960; tab[2][6][6][2] = 160; tab[2][6][7][1] = 0; tab[2][6][8][0] = 0; tab[2][7][0][1] = 19; tab[2][7][1][0] = 19; tab[2][7][0][2] = 114; tab[2][7][1][1] = 228; tab[2][7][2][0] = 114; tab[2][7][0][3] = 285; tab[2][7][1][2] = 969; tab[2][7][2][1] = 969; tab[2][7][3][0] = 285; tab[2][7][0][4] = 380; tab[2][7][1][3] = 2090; tab[2][7][2][2] = 3420; tab[2][7][3][1] = 2090; tab[2][7][4][0] = 380; tab[2][7][0][5] = 285; tab[2][7][1][4] = 2565; tab[2][7][2][3] = 6555; tab[2][7][3][2] = 6555; tab[2][7][4][1] = 2565; tab[2][7][5][0] = 285; tab[2][7][0][6] = 114; tab[2][7][1][5] = 1824; tab[2][7][2][4] = 7410; tab[2][7][3][3] = 11400; tab[2][7][4][2] = 7410; tab[2][7][5][1] = 1824; tab[2][7][6][0] = 114; tab[2][7][0][7] = 19; tab[2][7][1][6] = 703; tab[2][7][2][5] = 4959; tab[2][7][3][4] = 11875; tab[2][7][4][3] = 11875; tab[2][7][5][2] = 4959; tab[2][7][6][1] = 703; tab[2][7][7][0] = 19; tab[2][7][0][8] = 0; tab[2][7][1][7] = 114; tab[2][7][2][6] = 1824; tab[2][7][3][5] = 7410; tab[2][7][4][4] = 11400; tab[2][7][5][3] = 7410; tab[2][7][6][2] = 1824; tab[2][7][7][1] = 114; tab[2][7][8][0] = 0; tab[2][8][0][1] = 22; tab[2][8][1][0] = 22; tab[2][8][0][2] = 154; tab[2][8][1][1] = 308; tab[2][8][2][0] = 154; tab[2][8][0][3] = 462; tab[2][8][1][2] = 1540; tab[2][8][2][1] = 1540; tab[2][8][3][0] = 462; tab[2][8][0][4] = 770; tab[2][8][1][3] = 4004; tab[2][8][2][2] = 6468; tab[2][8][3][1] = 4004; tab[2][8][4][0] = 770; tab[2][8][0][5] = 770; tab[2][8][1][4] = 6160; tab[2][8][2][3] = 15092; tab[2][8][3][2] = 15092; tab[2][8][4][1] = 6160; tab[2][8][5][0] = 770; tab[2][8][0][6] = 462; tab[2][8][1][5] = 5852; tab[2][8][2][4] = 21560; tab[2][8][3][3] = 32340; tab[2][8][4][2] = 21560; tab[2][8][5][1] = 5852; tab[2][8][6][0] = 462; tab[2][8][0][7] = 154; tab[2][8][1][6] = 3388; tab[2][8][2][5] = 19404; tab[2][8][3][4] = 43120; tab[2][8][4][3] = 43120; tab[2][8][5][2] = 19404; tab[2][8][6][1] = 3388; tab[2][8][7][0] = 154; tab[2][8][0][8] = 22; tab[2][8][1][7] = 1100; tab[2][8][2][6] = 10780; tab[2][8][3][5] = 36652; tab[2][8][4][4] = 53900; tab[2][8][5][3] = 36652; tab[2][8][6][2] = 10780; tab[2][8][7][1] = 1100; tab[2][8][8][0] = 22; tab[3][1][0][1] = 2; tab[3][1][1][0] = 2; tab[3][1][0][2] = 0; tab[3][1][1][1] = 2; tab[3][1][2][0] = 2; tab[3][2][0][1] = 7; tab[3][2][1][0] = 7; tab[3][2][0][2] = 14; tab[3][2][1][1] = 28; tab[3][2][2][0] = 14; tab[3][2][0][3] = 7; tab[3][2][1][2] = 35; tab[3][2][2][1] = 35; tab[3][2][3][0] = 7; tab[3][2][0][4] = 0; tab[3][2][1][3] = 14; tab[3][2][2][2] = 28; tab[3][2][3][1] = 14; tab[3][2][4][0] = 0; tab[3][2][0][5] = 0; tab[3][2][1][4] = 0; tab[3][2][2][3] = 7; tab[3][2][3][2] = 7; tab[3][2][4][1] = 0; tab[3][2][5][0] = 0; tab[3][3][0][1] = 12; tab[3][3][1][0] = 12; tab[3][3][0][2] = 36; tab[3][3][1][1] = 84; tab[3][3][2][0] = 48; tab[3][3][0][3] = 36; tab[3][3][1][2] = 180; tab[3][3][2][1] = 216; tab[3][3][3][0] = 72; tab[3][3][0][4] = 12; tab[3][3][1][3] = 156; tab[3][3][2][2] = 360; tab[3][3][3][1] = 264; tab[3][3][4][0] = 48; tab[3][3][0][5] = 0; tab[3][3][1][4] = 48; tab[3][3][2][3] = 264; tab[3][3][3][2] = 360; tab[3][3][4][1] = 156; tab[3][3][5][0] = 12; tab[3][3][0][6] = 0; tab[3][3][1][5] = 0; tab[3][3][2][4] = 72; tab[3][3][3][3] = 216; tab[3][3][4][2] = 180; tab[3][3][5][1] = 36; tab[3][3][6][0] = 0; tab[3][3][0][7] = 0; tab[3][3][1][6] = 0; tab[3][3][2][5] = 0; tab[3][3][3][4] = 48; tab[3][3][4][3] = 84; tab[3][3][5][2] = 36; tab[3][3][6][1] = 0; tab[3][3][7][0] = 0; tab[3][3][0][8] = 0; tab[3][3][1][7] = 0; tab[3][3][2][6] = 0; tab[3][3][3][5] = 0; tab[3][3][4][4] = 12; tab[3][3][5][3] = 12; tab[3][3][6][2] = 0; tab[3][3][7][1] = 0; tab[3][3][8][0] = 0; tab[3][4][0][1] = 17; tab[3][4][1][0] = 17; tab[3][4][0][2] = 85; tab[3][4][1][1] = 170; tab[3][4][2][0] = 85; tab[3][4][0][3] = 170; tab[3][4][1][2] = 595; tab[3][4][2][1] = 595; tab[3][4][3][0] = 170; tab[3][4][0][4] = 170; tab[3][4][1][3] = 1020; tab[3][4][2][2] = 1700; tab[3][4][3][1] = 1020; tab[3][4][4][0] = 170; tab[3][4][0][5] = 85; tab[3][4][1][4] = 935; tab[3][4][2][3] = 2550; tab[3][4][3][2] = 2550; tab[3][4][4][1] = 935; tab[3][4][5][0] = 85; tab[3][4][0][6] = 17; tab[3][4][1][5] = 442; tab[3][4][2][4] = 2125; tab[3][4][3][3] = 3400; tab[3][4][4][2] = 2125; tab[3][4][5][1] = 442; tab[3][4][6][0] = 17; tab[3][4][0][7] = 0; tab[3][4][1][6] = 85; tab[3][4][2][5] = 935; tab[3][4][3][4] = 2550; tab[3][4][4][3] = 2550; tab[3][4][5][2] = 935; tab[3][4][6][1] = 85; tab[3][4][7][0] = 0; tab[3][4][0][8] = 0; tab[3][4][1][7] = 0; tab[3][4][2][6] = 170; tab[3][4][3][5] = 1020; tab[3][4][4][4] = 1700; tab[3][4][5][3] = 1020; tab[3][4][6][2] = 170; tab[3][4][7][1] = 0; tab[3][4][8][0] = 0; tab[3][5][0][1] = 22; tab[3][5][1][0] = 22; tab[3][5][0][2] = 132; tab[3][5][1][1] = 286; tab[3][5][2][0] = 154; tab[3][5][0][3] = 330; tab[3][5][1][2] = 1254; tab[3][5][2][1] = 1386; tab[3][5][3][0] = 462; tab[3][5][0][4] = 440; tab[3][5][1][3] = 2750; tab[3][5][2][2] = 5082; tab[3][5][3][1] = 3542; tab[3][5][4][0] = 770; tab[3][5][0][5] = 330; tab[3][5][1][4] = 3410; tab[3][5][2][3] = 10010; tab[3][5][3][2] = 11550; tab[3][5][4][1] = 5390; tab[3][5][5][0] = 770; tab[3][5][0][6] = 132; tab[3][5][1][5] = 2442; tab[3][5][2][4] = 11550; tab[3][5][3][3] = 20790; tab[3][5][4][2] = 16170; tab[3][5][5][1] = 5082; tab[3][5][6][0] = 462; tab[3][5][0][7] = 22; tab[3][5][1][6] = 946; tab[3][5][2][5] = 7854; tab[3][5][3][4] = 22330; tab[3][5][4][3] = 26950; tab[3][5][5][2] = 14322; tab[3][5][6][1] = 2926; tab[3][5][7][0] = 154; tab[3][5][0][8] = 0; tab[3][5][1][7] = 154; tab[3][5][2][6] = 2926; tab[3][5][3][5] = 14322; tab[3][5][4][4] = 26950; tab[3][5][5][3] = 22330; tab[3][5][6][2] = 7854; tab[3][5][7][1] = 946; tab[3][5][8][0] = 22; tab[3][6][0][1] = 27; tab[3][6][1][0] = 27; tab[3][6][0][2] = 216; tab[3][6][1][1] = 432; tab[3][6][2][0] = 216; tab[3][6][0][3] = 756; tab[3][6][1][2] = 2484; tab[3][6][2][1] = 2484; tab[3][6][3][0] = 756; tab[3][6][0][4] = 1512; tab[3][6][1][3] = 7560; tab[3][6][2][2] = 12096; tab[3][6][3][1] = 7560; tab[3][6][4][0] = 1512; tab[3][6][0][5] = 1890; tab[3][6][1][4] = 13986; tab[3][6][2][3] = 33264; tab[3][6][3][2] = 33264; tab[3][6][4][1] = 13986; tab[3][6][5][0] = 1890; tab[3][6][0][6] = 1512; tab[3][6][1][5] = 16632; tab[3][6][2][4] = 57456; tab[3][6][3][3] = 84672; tab[3][6][4][2] = 57456; tab[3][6][5][1] = 16632; tab[3][6][6][0] = 1512; tab[3][6][0][7] = 756; tab[3][6][1][6] = 12852; tab[3][6][2][5] = 65016; tab[3][6][3][4] = 137592; tab[3][6][4][3] = 137592; tab[3][6][5][2] = 65016; tab[3][6][6][1] = 12852; tab[3][6][7][0] = 756; tab[3][6][0][8] = 216; tab[3][6][1][7] = 6264; tab[3][6][2][6] = 48384; tab[3][6][3][5] = 148176; tab[3][6][4][4] = 211680; tab[3][6][5][3] = 148176; tab[3][6][6][2] = 48384; tab[3][6][7][1] = 6264; tab[3][6][8][0] = 216; tab[3][7][0][1] = 32; tab[3][7][1][0] = 32; tab[3][7][0][2] = 288; tab[3][7][1][1] = 608; tab[3][7][2][0] = 320; tab[3][7][0][3] = 1152; tab[3][7][1][2] = 4032; tab[3][7][2][1] = 4320; tab[3][7][3][0] = 1440; tab[3][7][0][4] = 2688; tab[3][7][1][3] = 14208; tab[3][7][2][2] = 24480; tab[3][7][3][1] = 16800; tab[3][7][4][0] = 3840; tab[3][7][0][5] = 4032; tab[3][7][1][4] = 30912; tab[3][7][2][3] = 78720; tab[3][7][3][2] = 86400; tab[3][7][4][1] = 41280; tab[3][7][5][0] = 6720; tab[3][7][0][6] = 4032; tab[3][7][1][5] = 44352; tab[3][7][2][4] = 161280; tab[3][7][3][3] = 259200; tab[3][7][4][2] = 198720; tab[3][7][5][1] = 68544; tab[3][7][6][0] = 8064; tab[3][7][0][7] = 2688; tab[3][7][1][6] = 43008; tab[3][7][2][5] = 221760; tab[3][7][3][4] = 504000; tab[3][7][4][3] = 564480; tab[3][7][5][2] = 314496; tab[3][7][6][1] = 79296; tab[3][7][7][0] = 6720; tab[3][7][0][8] = 1152; tab[3][7][1][7] = 28032; tab[3][7][2][6] = 208320; tab[3][7][3][5] = 665280; tab[3][7][4][4] = 1048320; tab[3][7][5][3] = 854784; tab[3][7][6][2] = 350784; tab[3][7][7][1] = 64320; tab[3][7][8][0] = 3840; tab[3][8][0][1] = 37; tab[3][8][1][0] = 37; tab[3][8][0][2] = 407; tab[3][8][1][1] = 814; tab[3][8][2][0] = 407; tab[3][8][0][3] = 2035; tab[3][8][1][2] = 6512; tab[3][8][2][1] = 6512; tab[3][8][3][0] = 2035; tab[3][8][0][4] = 6105; tab[3][8][1][3] = 28490; tab[3][8][2][2] = 44770; tab[3][8][3][1] = 28490; tab[3][8][4][0] = 6105; tab[3][8][0][5] = 12210; tab[3][8][1][4] = 79365; tab[3][8][2][3] = 179080; tab[3][8][3][2] = 179080; tab[3][8][4][1] = 79365; tab[3][8][5][0] = 12210; tab[3][8][0][6] = 17094; tab[3][8][1][5] = 151404; tab[3][8][2][4] = 470085; tab[3][8][3][3] = 671550; tab[3][8][4][2] = 470085; tab[3][8][5][1] = 151404; tab[3][8][6][0] = 17094; tab[3][8][0][7] = 17094; tab[3][8][1][6] = 205128; tab[3][8][2][5] = 859584; tab[3][8][3][4] = 1678875; tab[3][8][4][3] = 1678875; tab[3][8][5][2] = 859584; tab[3][8][6][1] = 205128; tab[3][8][7][0] = 17094; tab[3][8][0][8] = 12210; tab[3][8][1][7] = 200244; tab[3][8][2][6] = 1128204; tab[3][8][3][5] = 2954820; tab[3][8][4][4] = 4029300; tab[3][8][5][3] = 2954820; tab[3][8][6][2] = 1128204; tab[3][8][7][1] = 200244; tab[3][8][8][0] = 12210; tab[4][1][0][1] = 3; tab[4][1][1][0] = 3; tab[4][1][0][2] = 3; tab[4][1][1][1] = 6; tab[4][1][2][0] = 3; tab[4][1][0][3] = 0; tab[4][1][1][2] = 3; tab[4][1][2][1] = 3; tab[4][1][3][0] = 0; tab[4][2][0][1] = 10; tab[4][2][1][0] = 10; tab[4][2][0][2] = 30; tab[4][2][1][1] = 60; tab[4][2][2][0] = 30; tab[4][2][0][3] = 30; tab[4][2][1][2] = 120; tab[4][2][2][1] = 120; tab[4][2][3][0] = 30; tab[4][2][0][4] = 10; tab[4][2][1][3] = 100; tab[4][2][2][2] = 180; tab[4][2][3][1] = 100; tab[4][2][4][0] = 10; tab[4][2][0][5] = 0; tab[4][2][1][4] = 30; tab[4][2][2][3] = 120; tab[4][2][3][2] = 120; tab[4][2][4][1] = 30; tab[4][2][5][0] = 0; tab[4][2][0][6] = 0; tab[4][2][1][5] = 0; tab[4][2][2][4] = 30; tab[4][2][3][3] = 60; tab[4][2][4][2] = 30; tab[4][2][5][1] = 0; tab[4][2][6][0] = 0; tab[4][2][0][7] = 0; tab[4][2][1][6] = 0; tab[4][2][2][5] = 0; tab[4][2][3][4] = 10; tab[4][2][4][3] = 10; tab[4][2][5][2] = 0; tab[4][2][6][1] = 0; tab[4][2][7][0] = 0; tab[4][3][0][1] = 17; tab[4][3][1][0] = 17; tab[4][3][0][2] = 85; tab[4][3][1][1] = 170; tab[4][3][2][0] = 85; tab[4][3][0][3] = 170; tab[4][3][1][2] = 595; tab[4][3][2][1] = 595; tab[4][3][3][0] = 170; tab[4][3][0][4] = 170; tab[4][3][1][3] = 1020; tab[4][3][2][2] = 1700; tab[4][3][3][1] = 1020; tab[4][3][4][0] = 170; tab[4][3][0][5] = 85; tab[4][3][1][4] = 935; tab[4][3][2][3] = 2550; tab[4][3][3][2] = 2550; tab[4][3][4][1] = 935; tab[4][3][5][0] = 85; tab[4][3][0][6] = 17; tab[4][3][1][5] = 442; tab[4][3][2][4] = 2125; tab[4][3][3][3] = 3400; tab[4][3][4][2] = 2125; tab[4][3][5][1] = 442; tab[4][3][6][0] = 17; tab[4][3][0][7] = 0; tab[4][3][1][6] = 85; tab[4][3][2][5] = 935; tab[4][3][3][4] = 2550; tab[4][3][4][3] = 2550; tab[4][3][5][2] = 935; tab[4][3][6][1] = 85; tab[4][3][7][0] = 0; tab[4][3][0][8] = 0; tab[4][3][1][7] = 0; tab[4][3][2][6] = 170; tab[4][3][3][5] = 1020; tab[4][3][4][4] = 1700; tab[4][3][5][3] = 1020; tab[4][3][6][2] = 170; tab[4][3][7][1] = 0; tab[4][3][8][0] = 0; tab[4][4][0][1] = 24; tab[4][4][1][0] = 24; tab[4][4][0][2] = 168; tab[4][4][1][1] = 336; tab[4][4][2][0] = 168; tab[4][4][0][3] = 504; tab[4][4][1][2] = 1680; tab[4][4][2][1] = 1680; tab[4][4][3][0] = 504; tab[4][4][0][4] = 840; tab[4][4][1][3] = 4368; tab[4][4][2][2] = 7056; tab[4][4][3][1] = 4368; tab[4][4][4][0] = 840; tab[4][4][0][5] = 840; tab[4][4][1][4] = 6720; tab[4][4][2][3] = 16464; tab[4][4][3][2] = 16464; tab[4][4][4][1] = 6720; tab[4][4][5][0] = 840; tab[4][4][0][6] = 504; tab[4][4][1][5] = 6384; tab[4][4][2][4] = 23520; tab[4][4][3][3] = 35280; tab[4][4][4][2] = 23520; tab[4][4][5][1] = 6384; tab[4][4][6][0] = 504; tab[4][4][0][7] = 168; tab[4][4][1][6] = 3696; tab[4][4][2][5] = 21168; tab[4][4][3][4] = 47040; tab[4][4][4][3] = 47040; tab[4][4][5][2] = 21168; tab[4][4][6][1] = 3696; tab[4][4][7][0] = 168; tab[4][4][0][8] = 24; tab[4][4][1][7] = 1200; tab[4][4][2][6] = 11760; tab[4][4][3][5] = 39984; tab[4][4][4][4] = 58800; tab[4][4][5][3] = 39984; tab[4][4][6][2] = 11760; tab[4][4][7][1] = 1200; tab[4][4][8][0] = 24; tab[4][5][0][1] = 31; tab[4][5][1][0] = 31; tab[4][5][0][2] = 279; tab[4][5][1][1] = 558; tab[4][5][2][0] = 279; tab[4][5][0][3] = 1116; tab[4][5][1][2] = 3627; tab[4][5][2][1] = 3627; tab[4][5][3][0] = 1116; tab[4][5][0][4] = 2604; tab[4][5][1][3] = 12648; tab[4][5][2][2] = 20088; tab[4][5][3][1] = 12648; tab[4][5][4][0] = 2604; tab[4][5][0][5] = 3906; tab[4][5][1][4] = 27342; tab[4][5][2][3] = 63612; tab[4][5][3][2] = 63612; tab[4][5][4][1] = 27342; tab[4][5][5][0] = 3906; tab[4][5][0][6] = 3906; tab[4][5][1][5] = 39060; tab[4][5][2][4] = 128898; tab[4][5][3][3] = 187488; tab[4][5][4][2] = 128898; tab[4][5][5][1] = 39060; tab[4][5][6][0] = 3906; tab[4][5][0][7] = 2604; tab[4][5][1][6] = 37758; tab[4][5][2][5] = 175770; tab[4][5][3][4] = 359352; tab[4][5][4][3] = 359352; tab[4][5][5][2] = 175770; tab[4][5][6][1] = 37758; tab[4][5][7][0] = 2604; tab[4][5][0][8] = 1116; tab[4][5][1][7] = 24552; tab[4][5][2][6] = 164052; tab[4][5][3][5] = 468720; tab[4][5][4][4] = 656208; tab[4][5][5][3] = 468720; tab[4][5][6][2] = 164052; tab[4][5][7][1] = 24552; tab[4][5][8][0] = 1116; tab[4][6][0][1] = 38; tab[4][6][1][0] = 38; tab[4][6][0][2] = 418; tab[4][6][1][1] = 836; tab[4][6][2][0] = 418; tab[4][6][0][3] = 2090; tab[4][6][1][2] = 6688; tab[4][6][2][1] = 6688; tab[4][6][3][0] = 2090; tab[4][6][0][4] = 6270; tab[4][6][1][3] = 29260; tab[4][6][2][2] = 45980; tab[4][6][3][1] = 29260; tab[4][6][4][0] = 6270; tab[4][6][0][5] = 12540; tab[4][6][1][4] = 81510; tab[4][6][2][3] = 183920; tab[4][6][3][2] = 183920; tab[4][6][4][1] = 81510; tab[4][6][5][0] = 12540; tab[4][6][0][6] = 17556; tab[4][6][1][5] = 155496; tab[4][6][2][4] = 482790; tab[4][6][3][3] = 689700; tab[4][6][4][2] = 482790; tab[4][6][5][1] = 155496; tab[4][6][6][0] = 17556; tab[4][6][0][7] = 17556; tab[4][6][1][6] = 210672; tab[4][6][2][5] = 882816; tab[4][6][3][4] = 1724250; tab[4][6][4][3] = 1724250; tab[4][6][5][2] = 882816; tab[4][6][6][1] = 210672; tab[4][6][7][0] = 17556; tab[4][6][0][8] = 12540; tab[4][6][1][7] = 205656; tab[4][6][2][6] = 1158696; tab[4][6][3][5] = 3034680; tab[4][6][4][4] = 4138200; tab[4][6][5][3] = 3034680; tab[4][6][6][2] = 1158696; tab[4][6][7][1] = 205656; tab[4][6][8][0] = 12540; tab[4][7][0][1] = 45; tab[4][7][1][0] = 45; tab[4][7][0][2] = 585; tab[4][7][1][1] = 1170; tab[4][7][2][0] = 585; tab[4][7][0][3] = 3510; tab[4][7][1][2] = 11115; tab[4][7][2][1] = 11115; tab[4][7][3][0] = 3510; tab[4][7][0][4] = 12870; tab[4][7][1][3] = 58500; tab[4][7][2][2] = 91260; tab[4][7][3][1] = 58500; tab[4][7][4][0] = 12870; tab[4][7][0][5] = 32175; tab[4][7][1][4] = 199485; tab[4][7][2][3] = 441090; tab[4][7][3][2] = 441090; tab[4][7][4][1] = 199485; tab[4][7][5][0] = 32175; tab[4][7][0][6] = 57915; tab[4][7][1][5] = 476190; tab[4][7][2][4] = 1422135; tab[4][7][3][3] = 2007720; tab[4][7][4][2] = 1422135; tab[4][7][5][1] = 476190; tab[4][7][6][0] = 57915; tab[4][7][0][7] = 77220; tab[4][7][1][6] = 830115; tab[4][7][2][5] = 3262545; tab[4][7][3][4] = 6190470; tab[4][7][4][3] = 6190470; tab[4][7][5][2] = 3262545; tab[4][7][6][1] = 830115; tab[4][7][7][0] = 77220; tab[4][7][0][8] = 77220; tab[4][7][1][7] = 1081080; tab[4][7][2][6] = 5521230; tab[4][7][3][5] = 13719420; tab[4][7][4][4] = 18404100; tab[4][7][5][3] = 13719420; tab[4][7][6][2] = 5521230; tab[4][7][7][1] = 1081080; tab[4][7][8][0] = 77220; tab[4][8][0][1] = 52; tab[4][8][1][0] = 52; tab[4][8][0][2] = 780; tab[4][8][1][1] = 1560; tab[4][8][2][0] = 780; tab[4][8][0][3] = 5460; tab[4][8][1][2] = 17160; tab[4][8][2][1] = 17160; tab[4][8][3][0] = 5460; tab[4][8][0][4] = 23660; tab[4][8][1][3] = 105560; tab[4][8][2][2] = 163800; tab[4][8][3][1] = 105560; tab[4][8][4][0] = 23660; tab[4][8][0][5] = 70980; tab[4][8][1][4] = 425880; tab[4][8][2][3] = 928200; tab[4][8][3][2] = 928200; tab[4][8][4][1] = 425880; tab[4][8][5][0] = 70980; tab[4][8][0][6] = 156156; tab[4][8][1][5] = 1220856; tab[4][8][2][4] = 3549000; tab[4][8][3][3] = 4968600; tab[4][8][4][2] = 3549000; tab[4][8][5][1] = 1220856; tab[4][8][6][0] = 156156; tab[4][8][0][7] = 260260; tab[4][8][1][6] = 2602600; tab[4][8][2][5] = 9795240; tab[4][8][3][4] = 18218200; tab[4][8][4][3] = 18218200; tab[4][8][5][2] = 9795240; tab[4][8][6][1] = 2602600; tab[4][8][7][0] = 260260; tab[4][8][0][8] = 334620; tab[4][8][1][7] = 4238520; tab[4][8][2][6] = 20300280; tab[4][8][3][5] = 48692280; tab[4][8][4][4] = 64591800; tab[4][8][5][3] = 48692280; tab[4][8][6][2] = 20300280; tab[4][8][7][1] = 4238520; tab[4][8][8][0] = 334620; tab[5][1][0][1] = 4; tab[5][1][1][0] = 4; tab[5][1][0][2] = 4; tab[5][1][1][1] = 12; tab[5][1][2][0] = 8; tab[5][1][0][3] = 0; tab[5][1][1][2] = 8; tab[5][1][2][1] = 12; tab[5][1][3][0] = 4; tab[5][1][0][4] = 0; tab[5][1][1][3] = 0; tab[5][1][2][2] = 4; tab[5][1][3][1] = 4; tab[5][1][4][0] = 0; tab[5][2][0][1] = 13; tab[5][2][1][0] = 13; tab[5][2][0][2] = 52; tab[5][2][1][1] = 104; tab[5][2][2][0] = 52; tab[5][2][0][3] = 78; tab[5][2][1][2] = 286; tab[5][2][2][1] = 286; tab[5][2][3][0] = 78; tab[5][2][0][4] = 52; tab[5][2][1][3] = 364; tab[5][2][2][2] = 624; tab[5][2][3][1] = 364; tab[5][2][4][0] = 52; tab[5][2][0][5] = 13; tab[5][2][1][4] = 221; tab[5][2][2][3] = 676; tab[5][2][3][2] = 676; tab[5][2][4][1] = 221; tab[5][2][5][0] = 13; tab[5][2][0][6] = 0; tab[5][2][1][5] = 52; tab[5][2][2][4] = 364; tab[5][2][3][3] = 624; tab[5][2][4][2] = 364; tab[5][2][5][1] = 52; tab[5][2][6][0] = 0; tab[5][2][0][7] = 0; tab[5][2][1][6] = 0; tab[5][2][2][5] = 78; tab[5][2][3][4] = 286; tab[5][2][4][3] = 286; tab[5][2][5][2] = 78; tab[5][2][6][1] = 0; tab[5][2][7][0] = 0; tab[5][2][0][8] = 0; tab[5][2][1][7] = 0; tab[5][2][2][6] = 0; tab[5][2][3][5] = 52; tab[5][2][4][4] = 104; tab[5][2][5][3] = 52; tab[5][2][6][2] = 0; tab[5][2][7][1] = 0; tab[5][2][8][0] = 0; tab[5][3][0][1] = 22; tab[5][3][1][0] = 22; tab[5][3][0][2] = 132; tab[5][3][1][1] = 286; tab[5][3][2][0] = 154; tab[5][3][0][3] = 330; tab[5][3][1][2] = 1254; tab[5][3][2][1] = 1386; tab[5][3][3][0] = 462; tab[5][3][0][4] = 440; tab[5][3][1][3] = 2750; tab[5][3][2][2] = 5082; tab[5][3][3][1] = 3542; tab[5][3][4][0] = 770; tab[5][3][0][5] = 330; tab[5][3][1][4] = 3410; tab[5][3][2][3] = 10010; tab[5][3][3][2] = 11550; tab[5][3][4][1] = 5390; tab[5][3][5][0] = 770; tab[5][3][0][6] = 132; tab[5][3][1][5] = 2442; tab[5][3][2][4] = 11550; tab[5][3][3][3] = 20790; tab[5][3][4][2] = 16170; tab[5][3][5][1] = 5082; tab[5][3][6][0] = 462; tab[5][3][0][7] = 22; tab[5][3][1][6] = 946; tab[5][3][2][5] = 7854; tab[5][3][3][4] = 22330; tab[5][3][4][3] = 26950; tab[5][3][5][2] = 14322; tab[5][3][6][1] = 2926; tab[5][3][7][0] = 154; tab[5][3][0][8] = 0; tab[5][3][1][7] = 154; tab[5][3][2][6] = 2926; tab[5][3][3][5] = 14322; tab[5][3][4][4] = 26950; tab[5][3][5][3] = 22330; tab[5][3][6][2] = 7854; tab[5][3][7][1] = 946; tab[5][3][8][0] = 22; tab[5][4][0][1] = 31; tab[5][4][1][0] = 31; tab[5][4][0][2] = 279; tab[5][4][1][1] = 558; tab[5][4][2][0] = 279; tab[5][4][0][3] = 1116; tab[5][4][1][2] = 3627; tab[5][4][2][1] = 3627; tab[5][4][3][0] = 1116; tab[5][4][0][4] = 2604; tab[5][4][1][3] = 12648; tab[5][4][2][2] = 20088; tab[5][4][3][1] = 12648; tab[5][4][4][0] = 2604; tab[5][4][0][5] = 3906; tab[5][4][1][4] = 27342; tab[5][4][2][3] = 63612; tab[5][4][3][2] = 63612; tab[5][4][4][1] = 27342; tab[5][4][5][0] = 3906; tab[5][4][0][6] = 3906; tab[5][4][1][5] = 39060; tab[5][4][2][4] = 128898; tab[5][4][3][3] = 187488; tab[5][4][4][2] = 128898; tab[5][4][5][1] = 39060; tab[5][4][6][0] = 3906; tab[5][4][0][7] = 2604; tab[5][4][1][6] = 37758; tab[5][4][2][5] = 175770; tab[5][4][3][4] = 359352; tab[5][4][4][3] = 359352; tab[5][4][5][2] = 175770; tab[5][4][6][1] = 37758; tab[5][4][7][0] = 2604; tab[5][4][0][8] = 1116; tab[5][4][1][7] = 24552; tab[5][4][2][6] = 164052; tab[5][4][3][5] = 468720; tab[5][4][4][4] = 656208; tab[5][4][5][3] = 468720; tab[5][4][6][2] = 164052; tab[5][4][7][1] = 24552; tab[5][4][8][0] = 1116; tab[5][5][0][1] = 40; tab[5][5][1][0] = 40; tab[5][5][0][2] = 440; tab[5][5][1][1] = 920; tab[5][5][2][0] = 480; tab[5][5][0][3] = 2200; tab[5][5][1][2] = 7480; tab[5][5][2][1] = 7920; tab[5][5][3][0] = 2640; tab[5][5][0][4] = 6600; tab[5][5][1][3] = 33000; tab[5][5][2][2] = 55440; tab[5][5][3][1] = 37840; tab[5][5][4][0] = 8800; tab[5][5][0][5] = 13200; tab[5][5][1][4] = 92400; tab[5][5][2][3] = 224400; tab[5][5][3][2] = 242000; tab[5][5][4][1] = 116600; tab[5][5][5][0] = 19800; tab[5][5][0][6] = 18480; tab[5][5][1][5] = 176880; tab[5][5][2][4] = 594000; tab[5][5][3][3] = 919600; tab[5][5][4][2] = 701800; tab[5][5][5][1] = 249480; tab[5][5][6][0] = 31680; tab[5][5][0][7] = 18480; tab[5][5][1][6] = 240240; tab[5][5][2][5] = 1092960; tab[5][5][3][4] = 2323200; tab[5][5][4][3] = 2541000; tab[5][5][5][2] = 1437480; tab[5][5][6][1] = 385440; tab[5][5][7][0] = 36960; tab[5][5][0][8] = 13200; tab[5][5][1][7] = 234960; tab[5][5][2][6] = 1441440; tab[5][5][3][5] = 4123680; tab[5][5][4][4] = 6171000; tab[5][5][5][3] = 5009400; tab[5][5][6][2] = 2148960; tab[5][5][7][1] = 438240; tab[5][5][8][0] = 31680; tab[5][6][0][1] = 49; tab[5][6][1][0] = 49; tab[5][6][0][2] = 686; tab[5][6][1][1] = 1372; tab[5][6][2][0] = 686; tab[5][6][0][3] = 4459; tab[5][6][1][2] = 14063; tab[5][6][2][1] = 14063; tab[5][6][3][0] = 4459; tab[5][6][0][4] = 17836; tab[5][6][1][3] = 80262; tab[5][6][2][2] = 124852; tab[5][6][3][1] = 80262; tab[5][6][4][0] = 17836; tab[5][6][0][5] = 49049; tab[5][6][1][4] = 298753; tab[5][6][2][3] = 655473; tab[5][6][3][2] = 655473; tab[5][6][4][1] = 298753; tab[5][6][5][0] = 49049; tab[5][6][0][6] = 98098; tab[5][6][1][5] = 784784; tab[5][6][2][4] = 2309762; tab[5][6][3][3] = 3246152; tab[5][6][4][2] = 2309762; tab[5][6][5][1] = 784784; tab[5][6][6][0] = 98098; tab[5][6][0][7] = 147147; tab[5][6][1][6] = 1520519; tab[5][6][2][5] = 5836831; tab[5][6][3][4] = 10955763; tab[5][6][4][3] = 10955763; tab[5][6][5][2] = 5836831; tab[5][6][6][1] = 1520519; tab[5][6][7][0] = 147147; tab[5][6][0][8] = 168168; tab[5][6][1][7] = 2228226; tab[5][6][2][6] = 10986976; tab[5][6][3][5] = 26780754; tab[5][6][4][4] = 35707672; tab[5][6][5][3] = 26780754; tab[5][6][6][2] = 10986976; tab[5][6][7][1] = 2228226; tab[5][6][8][0] = 168168; tab[5][7][0][1] = 58; tab[5][7][1][0] = 58; tab[5][7][0][2] = 928; tab[5][7][1][1] = 1914; tab[5][7][2][0] = 986; tab[5][7][0][3] = 6960; tab[5][7][1][2] = 22736; tab[5][7][2][1] = 23664; tab[5][7][3][0] = 7888; tab[5][7][0][4] = 32480; tab[5][7][1][3] = 150800; tab[5][7][2][2] = 244528; tab[5][7][3][1] = 165648; tab[5][7][4][0] = 39440; tab[5][7][0][5] = 105560; tab[5][7][1][4] = 657720; tab[5][7][2][3] = 1498720; tab[5][7][3][2] = 1577600; tab[5][7][4][1] = 769080; tab[5][7][5][0] = 138040; tab[5][7][0][6] = 253344; tab[5][7][1][5] = 2047864; tab[5][7][2][4] = 6211800; tab[5][7][3][3] = 9150080; tab[5][7][4][2] = 6941440; tab[5][7][5][1] = 2567544; tab[5][7][6][0] = 358904; tab[5][7][0][7] = 464464; tab[5][7][1][6] = 4771312; tab[5][7][2][5] = 18663008; tab[5][7][3][4] = 36442560; tab[5][7][4][3] = 38651200; tab[5][7][5][2] = 22307264; tab[5][7][6][1] = 6460272; tab[5][7][7][0] = 717808; tab[5][7][0][8] = 663520; tab[5][7][1][7] = 8559408; tab[5][7][2][6] = 42350672; tab[5][7][3][5] = 106235584; tab[5][7][4][4] = 149083200; tab[5][7][5][3] = 120370880; tab[5][7][6][2] = 54553408; tab[5][7][7][1] = 12612912; tab[5][7][8][0] = 1127984; tab[5][8][0][1] = 67; tab[5][8][1][0] = 67; tab[5][8][0][2] = 1273; tab[5][8][1][1] = 2546; tab[5][8][2][0] = 1273; tab[5][8][0][3] = 11457; tab[5][8][1][2] = 35644; tab[5][8][2][1] = 35644; tab[5][8][3][0] = 11457; tab[5][8][0][4] = 64923; tab[5][8][1][3] = 282606; tab[5][8][2][2] = 435366; tab[5][8][3][1] = 282606; tab[5][8][4][0] = 64923; tab[5][8][0][5] = 259692; tab[5][8][1][4] = 1493229; tab[5][8][2][3] = 3192684; tab[5][8][3][2] = 3192684; tab[5][8][4][1] = 1493229; tab[5][8][5][0] = 259692; tab[5][8][0][6] = 779076; tab[5][8][1][5] = 5713224; tab[5][8][2][4] = 16035981; tab[5][8][3][3] = 22203666; tab[5][8][4][2] = 16035981; tab[5][8][5][1] = 5713224; tab[5][8][6][0] = 779076; tab[5][8][0][7] = 1817844; tab[5][8][1][6] = 16620288; tab[5][8][2][5] = 59209776; tab[5][8][3][4] = 107317719; tab[5][8][4][3] = 107317719; tab[5][8][5][2] = 59209776; tab[5][8][6][1] = 16620288; tab[5][8][7][0] = 1817844; tab[5][8][0][8] = 3375996; tab[5][8][1][7] = 37915032; tab[5][8][2][6] = 167761032; tab[5][8][3][5] = 384863544; tab[5][8][4][4] = 503283096; tab[5][8][5][3] = 384863544; tab[5][8][6][2] = 167761032; tab[5][8][7][1] = 37915032; tab[5][8][8][0] = 3375996; tab[6][1][0][1] = 5; tab[6][1][1][0] = 5; tab[6][1][0][2] = 10; tab[6][1][1][1] = 20; tab[6][1][2][0] = 10; tab[6][1][0][3] = 5; tab[6][1][1][2] = 25; tab[6][1][2][1] = 25; tab[6][1][3][0] = 5; tab[6][1][0][4] = 0; tab[6][1][1][3] = 10; tab[6][1][2][2] = 20; tab[6][1][3][1] = 10; tab[6][1][4][0] = 0; tab[6][1][0][5] = 0; tab[6][1][1][4] = 0; tab[6][1][2][3] = 5; tab[6][1][3][2] = 5; tab[6][1][4][1] = 0; tab[6][1][5][0] = 0; tab[6][2][0][1] = 16; tab[6][2][1][0] = 16; tab[6][2][0][2] = 80; tab[6][2][1][1] = 160; tab[6][2][2][0] = 80; tab[6][2][0][3] = 160; tab[6][2][1][2] = 560; tab[6][2][2][1] = 560; tab[6][2][3][0] = 160; tab[6][2][0][4] = 160; tab[6][2][1][3] = 960; tab[6][2][2][2] = 1600; tab[6][2][3][1] = 960; tab[6][2][4][0] = 160; tab[6][2][0][5] = 80; tab[6][2][1][4] = 880; tab[6][2][2][3] = 2400; tab[6][2][3][2] = 2400; tab[6][2][4][1] = 880; tab[6][2][5][0] = 80; tab[6][2][0][6] = 16; tab[6][2][1][5] = 416; tab[6][2][2][4] = 2000; tab[6][2][3][3] = 3200; tab[6][2][4][2] = 2000; tab[6][2][5][1] = 416; tab[6][2][6][0] = 16; tab[6][2][0][7] = 0; tab[6][2][1][6] = 80; tab[6][2][2][5] = 880; tab[6][2][3][4] = 2400; tab[6][2][4][3] = 2400; tab[6][2][5][2] = 880; tab[6][2][6][1] = 80; tab[6][2][7][0] = 0; tab[6][2][0][8] = 0; tab[6][2][1][7] = 0; tab[6][2][2][6] = 160; tab[6][2][3][5] = 960; tab[6][2][4][4] = 1600; tab[6][2][5][3] = 960; tab[6][2][6][2] = 160; tab[6][2][7][1] = 0; tab[6][2][8][0] = 0; tab[6][3][0][1] = 27; tab[6][3][1][0] = 27; tab[6][3][0][2] = 216; tab[6][3][1][1] = 432; tab[6][3][2][0] = 216; tab[6][3][0][3] = 756; tab[6][3][1][2] = 2484; tab[6][3][2][1] = 2484; tab[6][3][3][0] = 756; tab[6][3][0][4] = 1512; tab[6][3][1][3] = 7560; tab[6][3][2][2] = 12096; tab[6][3][3][1] = 7560; tab[6][3][4][0] = 1512; tab[6][3][0][5] = 1890; tab[6][3][1][4] = 13986; tab[6][3][2][3] = 33264; tab[6][3][3][2] = 33264; tab[6][3][4][1] = 13986; tab[6][3][5][0] = 1890; tab[6][3][0][6] = 1512; tab[6][3][1][5] = 16632; tab[6][3][2][4] = 57456; tab[6][3][3][3] = 84672; tab[6][3][4][2] = 57456; tab[6][3][5][1] = 16632; tab[6][3][6][0] = 1512; tab[6][3][0][7] = 756; tab[6][3][1][6] = 12852; tab[6][3][2][5] = 65016; tab[6][3][3][4] = 137592; tab[6][3][4][3] = 137592; tab[6][3][5][2] = 65016; tab[6][3][6][1] = 12852; tab[6][3][7][0] = 756; tab[6][3][0][8] = 216; tab[6][3][1][7] = 6264; tab[6][3][2][6] = 48384; tab[6][3][3][5] = 148176; tab[6][3][4][4] = 211680; tab[6][3][5][3] = 148176; tab[6][3][6][2] = 48384; tab[6][3][7][1] = 6264; tab[6][3][8][0] = 216; tab[6][4][0][1] = 38; tab[6][4][1][0] = 38; tab[6][4][0][2] = 418; tab[6][4][1][1] = 836; tab[6][4][2][0] = 418; tab[6][4][0][3] = 2090; tab[6][4][1][2] = 6688; tab[6][4][2][1] = 6688; tab[6][4][3][0] = 2090; tab[6][4][0][4] = 6270; tab[6][4][1][3] = 29260; tab[6][4][2][2] = 45980; tab[6][4][3][1] = 29260; tab[6][4][4][0] = 6270; tab[6][4][0][5] = 12540; tab[6][4][1][4] = 81510; tab[6][4][2][3] = 183920; tab[6][4][3][2] = 183920; tab[6][4][4][1] = 81510; tab[6][4][5][0] = 12540; tab[6][4][0][6] = 17556; tab[6][4][1][5] = 155496; tab[6][4][2][4] = 482790; tab[6][4][3][3] = 689700; tab[6][4][4][2] = 482790; tab[6][4][5][1] = 155496; tab[6][4][6][0] = 17556; tab[6][4][0][7] = 17556; tab[6][4][1][6] = 210672; tab[6][4][2][5] = 882816; tab[6][4][3][4] = 1724250; tab[6][4][4][3] = 1724250; tab[6][4][5][2] = 882816; tab[6][4][6][1] = 210672; tab[6][4][7][0] = 17556; tab[6][4][0][8] = 12540; tab[6][4][1][7] = 205656; tab[6][4][2][6] = 1158696; tab[6][4][3][5] = 3034680; tab[6][4][4][4] = 4138200; tab[6][4][5][3] = 3034680; tab[6][4][6][2] = 1158696; tab[6][4][7][1] = 205656; tab[6][4][8][0] = 12540; tab[6][5][0][1] = 49; tab[6][5][1][0] = 49; tab[6][5][0][2] = 686; tab[6][5][1][1] = 1372; tab[6][5][2][0] = 686; tab[6][5][0][3] = 4459; tab[6][5][1][2] = 14063; tab[6][5][2][1] = 14063; tab[6][5][3][0] = 4459; tab[6][5][0][4] = 17836; tab[6][5][1][3] = 80262; tab[6][5][2][2] = 124852; tab[6][5][3][1] = 80262; tab[6][5][4][0] = 17836; tab[6][5][0][5] = 49049; tab[6][5][1][4] = 298753; tab[6][5][2][3] = 655473; tab[6][5][3][2] = 655473; tab[6][5][4][1] = 298753; tab[6][5][5][0] = 49049; tab[6][5][0][6] = 98098; tab[6][5][1][5] = 784784; tab[6][5][2][4] = 2309762; tab[6][5][3][3] = 3246152; tab[6][5][4][2] = 2309762; tab[6][5][5][1] = 784784; tab[6][5][6][0] = 98098; tab[6][5][0][7] = 147147; tab[6][5][1][6] = 1520519; tab[6][5][2][5] = 5836831; tab[6][5][3][4] = 10955763; tab[6][5][4][3] = 10955763; tab[6][5][5][2] = 5836831; tab[6][5][6][1] = 1520519; tab[6][5][7][0] = 147147; tab[6][5][0][8] = 168168; tab[6][5][1][7] = 2228226; tab[6][5][2][6] = 10986976; tab[6][5][3][5] = 26780754; tab[6][5][4][4] = 35707672; tab[6][5][5][3] = 26780754; tab[6][5][6][2] = 10986976; tab[6][5][7][1] = 2228226; tab[6][5][8][0] = 168168; tab[6][6][0][1] = 60; tab[6][6][1][0] = 60; tab[6][6][0][2] = 1020; tab[6][6][1][1] = 2040; tab[6][6][2][0] = 1020; tab[6][6][0][3] = 8160; tab[6][6][1][2] = 25500; tab[6][6][2][1] = 25500; tab[6][6][3][0] = 8160; tab[6][6][0][4] = 40800; tab[6][6][1][3] = 179520; tab[6][6][2][2] = 277440; tab[6][6][3][1] = 179520; tab[6][6][4][0] = 40800; tab[6][6][0][5] = 142800; tab[6][6][1][4] = 836400; tab[6][6][2][3] = 1803360; tab[6][6][3][2] = 1803360; tab[6][6][4][1] = 836400; tab[6][6][5][0] = 142800; tab[6][6][0][6] = 371280; tab[6][6][1][5] = 2798880; tab[6][6][2][4] = 7976400; tab[6][6][3][3] = 11097600; tab[6][6][4][2] = 7976400; tab[6][6][5][1] = 2798880; tab[6][6][6][0] = 371280; tab[6][6][0][7] = 742560; tab[6][6][1][6] = 7054320; tab[6][6][2][5] = 25732560; tab[6][6][3][4] = 47164800; tab[6][6][4][3] = 47164800; tab[6][6][5][2] = 25732560; tab[6][6][6][1] = 7054320; tab[6][6][7][0] = 742560; tab[6][6][0][8] = 1166880; tab[6][6][1][7] = 13790400; tab[6][6][2][6] = 63117600; tab[6][6][3][5] = 147598080; tab[6][6][4][4] = 194208000; tab[6][6][5][3] = 147598080; tab[6][6][6][2] = 63117600; tab[6][6][7][1] = 13790400; tab[6][6][8][0] = 1166880; tab[6][7][0][1] = 71; tab[6][7][1][0] = 71; tab[6][7][0][2] = 1420; tab[6][7][1][1] = 2840; tab[6][7][2][0] = 1420; tab[6][7][0][3] = 13490; tab[6][7][1][2] = 41890; tab[6][7][2][1] = 41890; tab[6][7][3][0] = 13490; tab[6][7][0][4] = 80940; tab[6][7][1][3] = 350740; tab[6][7][2][2] = 539600; tab[6][7][3][1] = 350740; tab[6][7][4][0] = 80940; tab[6][7][0][5] = 343995; tab[6][7][1][4] = 1962795; tab[6][7][2][3] = 4181900; tab[6][7][3][2] = 4181900; tab[6][7][4][1] = 1962795; tab[6][7][5][0] = 343995; tab[6][7][0][6] = 1100784; tab[6][7][1][5] = 7980684; tab[6][7][2][4] = 22258500; tab[6][7][3][3] = 30757200; tab[6][7][4][2] = 22258500; tab[6][7][5][1] = 7980684; tab[6][7][6][0] = 1100784; tab[6][7][0][7] = 2751960; tab[6][7][1][6] = 24767640; tab[6][7][2][5] = 87374730; tab[6][7][3][4] = 157630650; tab[6][7][4][3] = 157630650; tab[6][7][5][2] = 87374730; tab[6][7][6][1] = 24767640; tab[6][7][7][0] = 2751960; tab[6][7][0][8] = 5503920; tab[6][7][1][7] = 60543120; tab[6][7][2][6] = 264188160; tab[6][7][3][5] = 601303260; tab[6][7][4][4] = 784308600; tab[6][7][5][3] = 601303260; tab[6][7][6][2] = 264188160; tab[6][7][7][1] = 60543120; tab[6][7][8][0] = 5503920; tab[6][8][0][1] = 82; tab[6][8][1][0] = 82; tab[6][8][0][2] = 1886; tab[6][8][1][1] = 3772; tab[6][8][2][0] = 1886; tab[6][8][0][3] = 20746; tab[6][8][1][2] = 64124; tab[6][8][2][1] = 64124; tab[6][8][3][0] = 20746; tab[6][8][0][4] = 145222; tab[6][8][1][3] = 622380; tab[6][8][2][2] = 954316; tab[6][8][3][1] = 622380; tab[6][8][4][0] = 145222; tab[6][8][0][5] = 726110; tab[6][8][1][4] = 4066216; tab[6][8][2][3] = 8588844; tab[6][8][3][2] = 8588844; tab[6][8][4][1] = 4066216; tab[6][8][5][0] = 726110; tab[6][8][0][6] = 2759218; tab[6][8][1][5] = 19459748; tab[6][8][2][4] = 53441696; tab[6][8][3][3] = 73482332; tab[6][8][4][2] = 53441696; tab[6][8][5][1] = 19459748; tab[6][8][6][0] = 2759218; tab[6][8][0][7] = 8277654; tab[6][8][1][6] = 71739668; tab[6][8][2][5] = 247167844; tab[6][8][3][4] = 440893992; tab[6][8][4][3] = 440893992; tab[6][8][5][2] = 247167844; tab[6][8][6][1] = 71739668; tab[6][8][7][0] = 8277654; tab[6][8][0][8] = 20102874; tab[6][8][1][7] = 210488916; tab[6][8][2][6] = 888468196; tab[6][8][3][5] = 1984022964; tab[6][8][4][4] = 2571881620; tab[6][8][5][3] = 1984022964; tab[6][8][6][2] = 888468196; tab[6][8][7][1] = 210488916; tab[6][8][8][0] = 20102874; tab[7][1][0][1] = 6; tab[7][1][1][0] = 6; tab[7][1][0][2] = 12; tab[7][1][1][1] = 30; tab[7][1][2][0] = 18; tab[7][1][0][3] = 6; tab[7][1][1][2] = 42; tab[7][1][2][1] = 54; tab[7][1][3][0] = 18; tab[7][1][0][4] = 0; tab[7][1][1][3] = 18; tab[7][1][2][2] = 54; tab[7][1][3][1] = 42; tab[7][1][4][0] = 6; tab[7][1][0][5] = 0; tab[7][1][1][4] = 0; tab[7][1][2][3] = 18; tab[7][1][3][2] = 30; tab[7][1][4][1] = 12; tab[7][1][5][0] = 0; tab[7][1][0][6] = 0; tab[7][1][1][5] = 0; tab[7][1][2][4] = 0; tab[7][1][3][3] = 6; tab[7][1][4][2] = 6; tab[7][1][5][1] = 0; tab[7][1][6][0] = 0; tab[7][2][0][1] = 19; tab[7][2][1][0] = 19; tab[7][2][0][2] = 114; tab[7][2][1][1] = 228; tab[7][2][2][0] = 114; tab[7][2][0][3] = 285; tab[7][2][1][2] = 969; tab[7][2][2][1] = 969; tab[7][2][3][0] = 285; tab[7][2][0][4] = 380; tab[7][2][1][3] = 2090; tab[7][2][2][2] = 3420; tab[7][2][3][1] = 2090; tab[7][2][4][0] = 380; tab[7][2][0][5] = 285; tab[7][2][1][4] = 2565; tab[7][2][2][3] = 6555; tab[7][2][3][2] = 6555; tab[7][2][4][1] = 2565; tab[7][2][5][0] = 285; tab[7][2][0][6] = 114; tab[7][2][1][5] = 1824; tab[7][2][2][4] = 7410; tab[7][2][3][3] = 11400; tab[7][2][4][2] = 7410; tab[7][2][5][1] = 1824; tab[7][2][6][0] = 114; tab[7][2][0][7] = 19; tab[7][2][1][6] = 703; tab[7][2][2][5] = 4959; tab[7][2][3][4] = 11875; tab[7][2][4][3] = 11875; tab[7][2][5][2] = 4959; tab[7][2][6][1] = 703; tab[7][2][7][0] = 19; tab[7][2][0][8] = 0; tab[7][2][1][7] = 114; tab[7][2][2][6] = 1824; tab[7][2][3][5] = 7410; tab[7][2][4][4] = 11400; tab[7][2][5][3] = 7410; tab[7][2][6][2] = 1824; tab[7][2][7][1] = 114; tab[7][2][8][0] = 0; tab[7][3][0][1] = 32; tab[7][3][1][0] = 32; tab[7][3][0][2] = 288; tab[7][3][1][1] = 608; tab[7][3][2][0] = 320; tab[7][3][0][3] = 1152; tab[7][3][1][2] = 4032; tab[7][3][2][1] = 4320; tab[7][3][3][0] = 1440; tab[7][3][0][4] = 2688; tab[7][3][1][3] = 14208; tab[7][3][2][2] = 24480; tab[7][3][3][1] = 16800; tab[7][3][4][0] = 3840; tab[7][3][0][5] = 4032; tab[7][3][1][4] = 30912; tab[7][3][2][3] = 78720; tab[7][3][3][2] = 86400; tab[7][3][4][1] = 41280; tab[7][3][5][0] = 6720; tab[7][3][0][6] = 4032; tab[7][3][1][5] = 44352; tab[7][3][2][4] = 161280; tab[7][3][3][3] = 259200; tab[7][3][4][2] = 198720; tab[7][3][5][1] = 68544; tab[7][3][6][0] = 8064; tab[7][3][0][7] = 2688; tab[7][3][1][6] = 43008; tab[7][3][2][5] = 221760; tab[7][3][3][4] = 504000; tab[7][3][4][3] = 564480; tab[7][3][5][2] = 314496; tab[7][3][6][1] = 79296; tab[7][3][7][0] = 6720; tab[7][3][0][8] = 1152; tab[7][3][1][7] = 28032; tab[7][3][2][6] = 208320; tab[7][3][3][5] = 665280; tab[7][3][4][4] = 1048320; tab[7][3][5][3] = 854784; tab[7][3][6][2] = 350784; tab[7][3][7][1] = 64320; tab[7][3][8][0] = 3840; tab[7][4][0][1] = 45; tab[7][4][1][0] = 45; tab[7][4][0][2] = 585; tab[7][4][1][1] = 1170; tab[7][4][2][0] = 585; tab[7][4][0][3] = 3510; tab[7][4][1][2] = 11115; tab[7][4][2][1] = 11115; tab[7][4][3][0] = 3510; tab[7][4][0][4] = 12870; tab[7][4][1][3] = 58500; tab[7][4][2][2] = 91260; tab[7][4][3][1] = 58500; tab[7][4][4][0] = 12870; tab[7][4][0][5] = 32175; tab[7][4][1][4] = 199485; tab[7][4][2][3] = 441090; tab[7][4][3][2] = 441090; tab[7][4][4][1] = 199485; tab[7][4][5][0] = 32175; tab[7][4][0][6] = 57915; tab[7][4][1][5] = 476190; tab[7][4][2][4] = 1422135; tab[7][4][3][3] = 2007720; tab[7][4][4][2] = 1422135; tab[7][4][5][1] = 476190; tab[7][4][6][0] = 57915; tab[7][4][0][7] = 77220; tab[7][4][1][6] = 830115; tab[7][4][2][5] = 3262545; tab[7][4][3][4] = 6190470; tab[7][4][4][3] = 6190470; tab[7][4][5][2] = 3262545; tab[7][4][6][1] = 830115; tab[7][4][7][0] = 77220; tab[7][4][0][8] = 77220; tab[7][4][1][7] = 1081080; tab[7][4][2][6] = 5521230; tab[7][4][3][5] = 13719420; tab[7][4][4][4] = 18404100; tab[7][4][5][3] = 13719420; tab[7][4][6][2] = 5521230; tab[7][4][7][1] = 1081080; tab[7][4][8][0] = 77220; tab[7][5][0][1] = 58; tab[7][5][1][0] = 58; tab[7][5][0][2] = 928; tab[7][5][1][1] = 1914; tab[7][5][2][0] = 986; tab[7][5][0][3] = 6960; tab[7][5][1][2] = 22736; tab[7][5][2][1] = 23664; tab[7][5][3][0] = 7888; tab[7][5][0][4] = 32480; tab[7][5][1][3] = 150800; tab[7][5][2][2] = 244528; tab[7][5][3][1] = 165648; tab[7][5][4][0] = 39440; tab[7][5][0][5] = 105560; tab[7][5][1][4] = 657720; tab[7][5][2][3] = 1498720; tab[7][5][3][2] = 1577600; tab[7][5][4][1] = 769080; tab[7][5][5][0] = 138040; tab[7][5][0][6] = 253344; tab[7][5][1][5] = 2047864; tab[7][5][2][4] = 6211800; tab[7][5][3][3] = 9150080; tab[7][5][4][2] = 6941440; tab[7][5][5][1] = 2567544; tab[7][5][6][0] = 358904; tab[7][5][0][7] = 464464; tab[7][5][1][6] = 4771312; tab[7][5][2][5] = 18663008; tab[7][5][3][4] = 36442560; tab[7][5][4][3] = 38651200; tab[7][5][5][2] = 22307264; tab[7][5][6][1] = 6460272; tab[7][5][7][0] = 717808; tab[7][5][0][8] = 663520; tab[7][5][1][7] = 8559408; tab[7][5][2][6] = 42350672; tab[7][5][3][5] = 106235584; tab[7][5][4][4] = 149083200; tab[7][5][5][3] = 120370880; tab[7][5][6][2] = 54553408; tab[7][5][7][1] = 12612912; tab[7][5][8][0] = 1127984; tab[7][6][0][1] = 71; tab[7][6][1][0] = 71; tab[7][6][0][2] = 1420; tab[7][6][1][1] = 2840; tab[7][6][2][0] = 1420; tab[7][6][0][3] = 13490; tab[7][6][1][2] = 41890; tab[7][6][2][1] = 41890; tab[7][6][3][0] = 13490; tab[7][6][0][4] = 80940; tab[7][6][1][3] = 350740; tab[7][6][2][2] = 539600; tab[7][6][3][1] = 350740; tab[7][6][4][0] = 80940; tab[7][6][0][5] = 343995; tab[7][6][1][4] = 1962795; tab[7][6][2][3] = 4181900; tab[7][6][3][2] = 4181900; tab[7][6][4][1] = 1962795; tab[7][6][5][0] = 343995; tab[7][6][0][6] = 1100784; tab[7][6][1][5] = 7980684; tab[7][6][2][4] = 22258500; tab[7][6][3][3] = 30757200; tab[7][6][4][2] = 22258500; tab[7][6][5][1] = 7980684; tab[7][6][6][0] = 1100784; tab[7][6][0][7] = 2751960; tab[7][6][1][6] = 24767640; tab[7][6][2][5] = 87374730; tab[7][6][3][4] = 157630650; tab[7][6][4][3] = 157630650; tab[7][6][5][2] = 87374730; tab[7][6][6][1] = 24767640; tab[7][6][7][0] = 2751960; tab[7][6][0][8] = 5503920; tab[7][6][1][7] = 60543120; tab[7][6][2][6] = 264188160; tab[7][6][3][5] = 601303260; tab[7][6][4][4] = 784308600; tab[7][6][5][3] = 601303260; tab[7][6][6][2] = 264188160; tab[7][6][7][1] = 60543120; tab[7][6][8][0] = 5503920; tab[7][7][0][1] = 84; tab[7][7][1][0] = 84; tab[7][7][0][2] = 1932; tab[7][7][1][1] = 3948; tab[7][7][2][0] = 2016; tab[7][7][0][3] = 21252; tab[7][7][1][2] = 67620; tab[7][7][2][1] = 69552; tab[7][7][3][0] = 23184; tab[7][7][0][4] = 148764; tab[7][7][1][3] = 658812; tab[7][7][2][2] = 1043280; tab[7][7][3][1] = 703248; tab[7][7][4][0] = 170016; tab[7][7][0][5] = 743820; tab[7][7][1][4] = 4314156; tab[7][7][2][3] = 9435888; tab[7][7][3][2] = 9775920; tab[7][7][4][1] = 4802952; tab[7][7][5][0] = 892584; tab[7][7][0][6] = 2826516; tab[7][7][1][5] = 20678196; tab[7][7][2][4] = 58910544; tab[7][7][3][3] = 84072912; tab[7][7][4][2] = 63543480; tab[7][7][5][1] = 24099768; tab[7][7][6][0] = 3570336; tab[7][7][0][7] = 8479548; tab[7][7][1][6] = 76315932; tab[7][7][2][5] = 273130704; tab[7][7][3][4] = 506392656; tab[7][7][4][3] = 526922088; tab[7][7][5][2] = 307941480; tab[7][7][6][1] = 93423792; tab[7][7][7][0] = 11306064; tab[7][7][0][8] = 20593188; tab[7][7][1][7] = 224102340; tab[7][7][2][6] = 983627568; tab[7][7][3][5] = 2285610096; tab[7][7][4][4] = 3086257944; tab[7][7][5][3] = 2484061272; tab[7][7][6][2] = 1163334480; tab[7][7][7][1] = 289112208; tab[7][7][8][0] = 29072736; tab[7][8][0][1] = 97; tab[7][8][1][0] = 97; tab[7][8][0][2] = 2619; tab[7][8][1][1] = 5238; tab[7][8][2][0] = 2619; tab[7][8][0][3] = 34047; tab[7][8][1][2] = 104760; tab[7][8][2][1] = 104760; tab[7][8][3][0] = 34047; tab[7][8][0][4] = 283725; tab[7][8][1][3] = 1202994; tab[7][8][2][2] = 1838538; tab[7][8][3][1] = 1202994; tab[7][8][4][0] = 283725; tab[7][8][0][5] = 1702350; tab[7][8][1][4] = 9362925; tab[7][8][2][3] = 19611072; tab[7][8][3][2] = 19611072; tab[7][8][4][1] = 9362925; tab[7][8][5][0] = 1702350; tab[7][8][0][6] = 7830810; tab[7][8][1][5] = 53794260; tab[7][8][2][4] = 145550925; tab[7][8][3][3] = 199174950; tab[7][8][4][2] = 145550925; tab[7][8][5][1] = 53794260; tab[7][8][6][0] = 7830810; tab[7][8][0][7] = 28712970; tab[7][8][1][6] = 240144840; tab[7][8][2][5] = 808956720; tab[7][8][3][4] = 1427420475; tab[7][8][4][3] = 1427420475; tab[7][8][5][2] = 808956720; tab[7][8][6][1] = 240144840; tab[7][8][7][0] = 28712970; tab[7][8][0][8] = 86138910; tab[7][8][1][7] = 861389100; tab[7][8][2][6] = 3523864500; tab[7][8][3][5] = 7727988060; tab[7][8][4][4] = 9958747500; tab[7][8][5][3] = 7727988060; tab[7][8][6][2] = 3523864500; tab[7][8][7][1] = 861389100; tab[7][8][8][0] = 86138910; tab[8][1][0][1] = 7; tab[8][1][1][0] = 7; tab[8][1][0][2] = 21; tab[8][1][1][1] = 42; tab[8][1][2][0] = 21; tab[8][1][0][3] = 21; tab[8][1][1][2] = 84; tab[8][1][2][1] = 84; tab[8][1][3][0] = 21; tab[8][1][0][4] = 7; tab[8][1][1][3] = 70; tab[8][1][2][2] = 126; tab[8][1][3][1] = 70; tab[8][1][4][0] = 7; tab[8][1][0][5] = 0; tab[8][1][1][4] = 21; tab[8][1][2][3] = 84; tab[8][1][3][2] = 84; tab[8][1][4][1] = 21; tab[8][1][5][0] = 0; tab[8][1][0][6] = 0; tab[8][1][1][5] = 0; tab[8][1][2][4] = 21; tab[8][1][3][3] = 42; tab[8][1][4][2] = 21; tab[8][1][5][1] = 0; tab[8][1][6][0] = 0; tab[8][1][0][7] = 0; tab[8][1][1][6] = 0; tab[8][1][2][5] = 0; tab[8][1][3][4] = 7; tab[8][1][4][3] = 7; tab[8][1][5][2] = 0; tab[8][1][6][1] = 0; tab[8][1][7][0] = 0; tab[8][2][0][1] = 22; tab[8][2][1][0] = 22; tab[8][2][0][2] = 154; tab[8][2][1][1] = 308; tab[8][2][2][0] = 154; tab[8][2][0][3] = 462; tab[8][2][1][2] = 1540; tab[8][2][2][1] = 1540; tab[8][2][3][0] = 462; tab[8][2][0][4] = 770; tab[8][2][1][3] = 4004; tab[8][2][2][2] = 6468; tab[8][2][3][1] = 4004; tab[8][2][4][0] = 770; tab[8][2][0][5] = 770; tab[8][2][1][4] = 6160; tab[8][2][2][3] = 15092; tab[8][2][3][2] = 15092; tab[8][2][4][1] = 6160; tab[8][2][5][0] = 770; tab[8][2][0][6] = 462; tab[8][2][1][5] = 5852; tab[8][2][2][4] = 21560; tab[8][2][3][3] = 32340; tab[8][2][4][2] = 21560; tab[8][2][5][1] = 5852; tab[8][2][6][0] = 462; tab[8][2][0][7] = 154; tab[8][2][1][6] = 3388; tab[8][2][2][5] = 19404; tab[8][2][3][4] = 43120; tab[8][2][4][3] = 43120; tab[8][2][5][2] = 19404; tab[8][2][6][1] = 3388; tab[8][2][7][0] = 154; tab[8][2][0][8] = 22; tab[8][2][1][7] = 1100; tab[8][2][2][6] = 10780; tab[8][2][3][5] = 36652; tab[8][2][4][4] = 53900; tab[8][2][5][3] = 36652; tab[8][2][6][2] = 10780; tab[8][2][7][1] = 1100; tab[8][2][8][0] = 22; tab[8][3][0][1] = 37; tab[8][3][1][0] = 37; tab[8][3][0][2] = 407; tab[8][3][1][1] = 814; tab[8][3][2][0] = 407; tab[8][3][0][3] = 2035; tab[8][3][1][2] = 6512; tab[8][3][2][1] = 6512; tab[8][3][3][0] = 2035; tab[8][3][0][4] = 6105; tab[8][3][1][3] = 28490; tab[8][3][2][2] = 44770; tab[8][3][3][1] = 28490; tab[8][3][4][0] = 6105; tab[8][3][0][5] = 12210; tab[8][3][1][4] = 79365; tab[8][3][2][3] = 179080; tab[8][3][3][2] = 179080; tab[8][3][4][1] = 79365; tab[8][3][5][0] = 12210; tab[8][3][0][6] = 17094; tab[8][3][1][5] = 151404; tab[8][3][2][4] = 470085; tab[8][3][3][3] = 671550; tab[8][3][4][2] = 470085; tab[8][3][5][1] = 151404; tab[8][3][6][0] = 17094; tab[8][3][0][7] = 17094; tab[8][3][1][6] = 205128; tab[8][3][2][5] = 859584; tab[8][3][3][4] = 1678875; tab[8][3][4][3] = 1678875; tab[8][3][5][2] = 859584; tab[8][3][6][1] = 205128; tab[8][3][7][0] = 17094; tab[8][3][0][8] = 12210; tab[8][3][1][7] = 200244; tab[8][3][2][6] = 1128204; tab[8][3][3][5] = 2954820; tab[8][3][4][4] = 4029300; tab[8][3][5][3] = 2954820; tab[8][3][6][2] = 1128204; tab[8][3][7][1] = 200244; tab[8][3][8][0] = 12210; tab[8][4][0][1] = 52; tab[8][4][1][0] = 52; tab[8][4][0][2] = 780; tab[8][4][1][1] = 1560; tab[8][4][2][0] = 780; tab[8][4][0][3] = 5460; tab[8][4][1][2] = 17160; tab[8][4][2][1] = 17160; tab[8][4][3][0] = 5460; tab[8][4][0][4] = 23660; tab[8][4][1][3] = 105560; tab[8][4][2][2] = 163800; tab[8][4][3][1] = 105560; tab[8][4][4][0] = 23660; tab[8][4][0][5] = 70980; tab[8][4][1][4] = 425880; tab[8][4][2][3] = 928200; tab[8][4][3][2] = 928200; tab[8][4][4][1] = 425880; tab[8][4][5][0] = 70980; tab[8][4][0][6] = 156156; tab[8][4][1][5] = 1220856; tab[8][4][2][4] = 3549000; tab[8][4][3][3] = 4968600; tab[8][4][4][2] = 3549000; tab[8][4][5][1] = 1220856; tab[8][4][6][0] = 156156; tab[8][4][0][7] = 260260; tab[8][4][1][6] = 2602600; tab[8][4][2][5] = 9795240; tab[8][4][3][4] = 18218200; tab[8][4][4][3] = 18218200; tab[8][4][5][2] = 9795240; tab[8][4][6][1] = 2602600; tab[8][4][7][0] = 260260; tab[8][4][0][8] = 334620; tab[8][4][1][7] = 4238520; tab[8][4][2][6] = 20300280; tab[8][4][3][5] = 48692280; tab[8][4][4][4] = 64591800; tab[8][4][5][3] = 48692280; tab[8][4][6][2] = 20300280; tab[8][4][7][1] = 4238520; tab[8][4][8][0] = 334620; tab[8][5][0][1] = 67; tab[8][5][1][0] = 67; tab[8][5][0][2] = 1273; tab[8][5][1][1] = 2546; tab[8][5][2][0] = 1273; tab[8][5][0][3] = 11457; tab[8][5][1][2] = 35644; tab[8][5][2][1] = 35644; tab[8][5][3][0] = 11457; tab[8][5][0][4] = 64923; tab[8][5][1][3] = 282606; tab[8][5][2][2] = 435366; tab[8][5][3][1] = 282606; tab[8][5][4][0] = 64923; tab[8][5][0][5] = 259692; tab[8][5][1][4] = 1493229; tab[8][5][2][3] = 3192684; tab[8][5][3][2] = 3192684; tab[8][5][4][1] = 1493229; tab[8][5][5][0] = 259692; tab[8][5][0][6] = 779076; tab[8][5][1][5] = 5713224; tab[8][5][2][4] = 16035981; tab[8][5][3][3] = 22203666; tab[8][5][4][2] = 16035981; tab[8][5][5][1] = 5713224; tab[8][5][6][0] = 779076; tab[8][5][0][7] = 1817844; tab[8][5][1][6] = 16620288; tab[8][5][2][5] = 59209776; tab[8][5][3][4] = 107317719; tab[8][5][4][3] = 107317719; tab[8][5][5][2] = 59209776; tab[8][5][6][1] = 16620288; tab[8][5][7][0] = 1817844; tab[8][5][0][8] = 3375996; tab[8][5][1][7] = 37915032; tab[8][5][2][6] = 167761032; tab[8][5][3][5] = 384863544; tab[8][5][4][4] = 503283096; tab[8][5][5][3] = 384863544; tab[8][5][6][2] = 167761032; tab[8][5][7][1] = 37915032; tab[8][5][8][0] = 3375996; tab[8][6][0][1] = 82; tab[8][6][1][0] = 82; tab[8][6][0][2] = 1886; tab[8][6][1][1] = 3772; tab[8][6][2][0] = 1886; tab[8][6][0][3] = 20746; tab[8][6][1][2] = 64124; tab[8][6][2][1] = 64124; tab[8][6][3][0] = 20746; tab[8][6][0][4] = 145222; tab[8][6][1][3] = 622380; tab[8][6][2][2] = 954316; tab[8][6][3][1] = 622380; tab[8][6][4][0] = 145222; tab[8][6][0][5] = 726110; tab[8][6][1][4] = 4066216; tab[8][6][2][3] = 8588844; tab[8][6][3][2] = 8588844; tab[8][6][4][1] = 4066216; tab[8][6][5][0] = 726110; tab[8][6][0][6] = 2759218; tab[8][6][1][5] = 19459748; tab[8][6][2][4] = 53441696; tab[8][6][3][3] = 73482332; tab[8][6][4][2] = 53441696; tab[8][6][5][1] = 19459748; tab[8][6][6][0] = 2759218; tab[8][6][0][7] = 8277654; tab[8][6][1][6] = 71739668; tab[8][6][2][5] = 247167844; tab[8][6][3][4] = 440893992; tab[8][6][4][3] = 440893992; tab[8][6][5][2] = 247167844; tab[8][6][6][1] = 71739668; tab[8][6][7][0] = 8277654; tab[8][6][0][8] = 20102874; tab[8][6][1][7] = 210488916; tab[8][6][2][6] = 888468196; tab[8][6][3][5] = 1984022964; tab[8][6][4][4] = 2571881620; tab[8][6][5][3] = 1984022964; tab[8][6][6][2] = 888468196; tab[8][6][7][1] = 210488916; tab[8][6][8][0] = 20102874; tab[8][7][0][1] = 97; tab[8][7][1][0] = 97; tab[8][7][0][2] = 2619; tab[8][7][1][1] = 5238; tab[8][7][2][0] = 2619; tab[8][7][0][3] = 34047; tab[8][7][1][2] = 104760; tab[8][7][2][1] = 104760; tab[8][7][3][0] = 34047; tab[8][7][0][4] = 283725; tab[8][7][1][3] = 1202994; tab[8][7][2][2] = 1838538; tab[8][7][3][1] = 1202994; tab[8][7][4][0] = 283725; tab[8][7][0][5] = 1702350; tab[8][7][1][4] = 9362925; tab[8][7][2][3] = 19611072; tab[8][7][3][2] = 19611072; tab[8][7][4][1] = 9362925; tab[8][7][5][0] = 1702350; tab[8][7][0][6] = 7830810; tab[8][7][1][5] = 53794260; tab[8][7][2][4] = 145550925; tab[8][7][3][3] = 199174950; tab[8][7][4][2] = 145550925; tab[8][7][5][1] = 53794260; tab[8][7][6][0] = 7830810; tab[8][7][0][7] = 28712970; tab[8][7][1][6] = 240144840; tab[8][7][2][5] = 808956720; tab[8][7][3][4] = 1427420475; tab[8][7][4][3] = 1427420475; tab[8][7][5][2] = 808956720; tab[8][7][6][1] = 240144840; tab[8][7][7][0] = 28712970; tab[8][7][0][8] = 86138910; tab[8][7][1][7] = 861389100; tab[8][7][2][6] = 3523864500; tab[8][7][3][5] = 7727988060; tab[8][7][4][4] = 9958747500; tab[8][7][5][3] = 7727988060; tab[8][7][6][2] = 3523864500; tab[8][7][7][1] = 861389100; tab[8][7][8][0] = 86138910; tab[8][8][0][1] = 112; tab[8][8][1][0] = 112; tab[8][8][0][2] = 3472; tab[8][8][1][1] = 6944; tab[8][8][2][0] = 3472; tab[8][8][0][3] = 52080; tab[8][8][1][2] = 159712; tab[8][8][2][1] = 159712; tab[8][8][3][0] = 52080; tab[8][8][0][4] = 503440; tab[8][8][1][3] = 2117920; tab[8][8][2][2] = 3228960; tab[8][8][3][1] = 2117920; tab[8][8][4][0] = 503440; tab[8][8][0][5] = 3524080; tab[8][8][1][4] = 19130720; tab[8][8][2][3] = 39823840; tab[8][8][3][2] = 39823840; tab[8][8][4][1] = 19130720; tab[8][8][5][0] = 3524080; tab[8][8][0][6] = 19030032; tab[8][8][1][5] = 128276512; tab[8][8][2][4] = 343346080; tab[8][8][3][3] = 468199200; tab[8][8][4][2] = 343346080; tab[8][8][5][1] = 128276512; tab[8][8][6][0] = 19030032; tab[8][8][0][7] = 82463472; tab[8][8][1][6] = 672394464; tab[8][8][2][5] = 2228628192; tab[8][8][3][4] = 3901660000; tab[8][8][4][3] = 3901660000; tab[8][8][5][2] = 2228628192; tab[8][8][6][1] = 672394464; tab[8][8][7][0] = 82463472; tab[8][8][0][8] = 294512400; tab[8][8][1][7] = 2850880032; tab[8][8][2][6] = 11405332512; tab[8][8][3][5] = 24689704480; tab[8][8][4][4] = 31681479200; tab[8][8][5][3] = 24689704480; tab[8][8][6][2] = 11405332512; tab[8][8][7][1] = 2850880032; tab[8][8][8][0] = 294512400; } void compute() { if(cnt[0] % 2 != parity[0] % 2) { ans(0); return; } preproc(); w = 0; par = cnt[0] % 2; for(int q = par; q <= kk; q += 2) { w += tab[n][m][q][kk - q]; } good = 0; f(i, n) { f(j, m) { if(board[i][j]) { if(i > 0 && !board[i - 1][j]) { good++; } if(i < n - 1 && !board[i + 1][j]) { good++; } if(j > 0 && !board[i][j - 1]) { good++; } if(j < m - 1 && !board[i][j + 1]) { good++; } } } } long double goodLD = ((long double)(good)); long double wLD = ((long double)(w)); printf("%.15Lf\n", (goodLD / wLD)); } |