2022.5.31———HZOI【高一提高组过渡1】这回倒是没爆0(
当然还是成绩综述
bikuhiku巨巨巨!!!
我一傻蛋30分————
题
T1 装饰
莫名想起初三A部德育主任建军经典名言——“解释就是掩饰,掩饰就是事实”
这一道题竟然是推规律题,不过细想还真是
可恶我考场上没找出来规律。。所以我只打了暴搜。。
CODE
#include <iostream> #include <iomanip> #include <cstdio> #include <cstring> #include <cctype> #include <cmath> #include <algorithm> #include <map> #define ll long long #define mem(x,y) memset(x,y,sizeof(x)) #define re register int #define ot(x) printf("%lld",x) #define lot(x) printf("%lld\n",x) #define MARK printf("~~~") #define _MARK printf("###") #define LMARK printf("@@@@@@") #define SLEEP printf("💤") #define SLEEPER printf("(~﹃~)~zZ") #define STUDY printf("📕") #define _ putchar(' ') #define MIN(x,y) ((x < y) ? (x) : (y)) #define MAX(x,y) ((x > y) ? (x) : (y)) #define endl putchar('\n') #define char_phi signed using namespace std; ll T,a,b,c,final_ans,mxx; inline ll read(){ ll x = 0; char c; while(!isdigit(c = getchar())); do{ x = (x << 3) + (x << 1) + (c & 15); }while(isdigit(c = getchar())); return x; } // ll dfs(ll a,ll b,ll c){ // ll res(0); // res += dfs(a-1,b-1,c-1); // res+= // } // ll mxxx(ll a1,ll a2,ll a3,ll a4,ll a5,ll a6,ll a7){ // a1 = MAX(a1,a2), a1 = MAX(a1,a3), a1 = MAX(a1,a4), a1 = MAX(a1,a5), a1 = MAX(a1,a6), a1 = MAX(a1,a7); // return a1; // } // ll dfs(ll a,ll b,ll c,ll qq){//震惊!!!蒟蒻大暴搜样例过了!!! // // SLEEPER,_,_,ot(qq),endl; // if(a + b + c < 3 || (a==0&&b==0) || (a==0&&c==0) || (b==0&&c==0)){ // // SLEEPER,_,ot(qq),endl; // return qq; // } // ll res1(0),res2(0),res3(0),res4(0),res5(0),res6(0),res7(0); // if(a >= 2 && b >= 1){ // // SLEEPER; // res1 = dfs(a-2,b-1,c,qq+1); // // ot(res1),endl; // } // if(a >= 2 && c >= 1){ // res2 = dfs(a-2,b,c-1,qq+1); // } // if(a >= 1 && b >= 2){ // res3 = dfs(a-1,b-2,c,qq+1); // } // if(a >= 1 && b >= 1 && c >= 1){ // res4 = dfs(a-1,b-1,c-1,qq+1); // } // if(a >= 1 && c >= 2){ // res5 = dfs(a-1,b,c-2,qq+1); // } // if(b >= 1 && c >= 2){ // res6 = dfs(a,b-1,c-2,qq+1); // } // if(b >= 2 && c >= 1){ // res7 = dfs(a,b-2,c-1,qq+1); // } // // SLEEP,ot(res1),_,ot(res2),_,ot(res3),_,ot(res4),_,ot(res5),_,ot(res6),_,ot(res7),putchar('\n'); // res1 = mxxx(res1,res2,res3,res4,res5,res6,res7); // return res1; // } void SWAPER(){ if(a > b) swap(a,b); if(b > c) swap(b,c); if(a > c) swap(a,c); } void work(){ //显然一道数论 //暴力枚举肯定不行—— //如果a,b,c中有两个为0就直接输出0 //先深搜,我太逊了 //可恶我一个蒟蒻连深搜都不会打 //又觉得像是dp———— //可恶暴力也不会打了qaq T = read(); // if(T == 5){ // puts("2"); // puts("0"); // puts("2"); // puts("4"); // puts("4"); // exit(0); // } while(T --){ a = read(), b = read(), c = read(); // mxx = MIN(mxx,A); // mxx = MIN(mxx,B); // mxx = MIN(mxx,C); if((a==0&&b==0) || (b==0&&c==0) || (a==0&&c==0)){ puts("0"); continue; } // map<string,bool> mp; // final_ans = rand()*rand(); // final_ans // lot(dfs(A,B,C,0)); // string ii,jj,kk,s; // for(re i = 0 ; i <= 2 ; ++ i){ // // ii.clear(), ii += i; // for(re j = 0 ; j <= 2 ; ++ j){ // // jj.clear(), jj+=j; // for(re k = 0 ; k <= 2 ; ++ k){ // // kk.clear(), kk+=k; // if(i + j + k == 3){ // // s = ii+jj+kk; // // cout << s << endl; // if(i<A && j<B && C<k){ // // mp[s] = true; // A -= i, B -=j, C -=k; // ++ final_ans; // } // } // } // } // } // for() // lot(mxx); SWAPER(); if(c >= ((a+b)<<1)){ printf("%lld\n",a+b); } else{ printf("%lld\n",((a+b+c)/3)); } } } char_phi main(){ freopen("decorate.in","r",stdin); freopen("decorate.out","w",stdout); work(); return 0; }
T2 中国象棋
嚯 这道题。。一眼看上去,又是深搜??
然后又觉得是数学
结果正解是状压。。
这道题有三种做法,第一种是DP(据说是状压??不过我不觉得这个像是状压。。),第二种是记忆化搜索,不过二者殊途同归吧
状压的代码很好写,把每种情况考虑好就ok了
DP
#include <iostream> #include <iomanip> #include <cstdio> #include <cstring> #include <cctype> #include <cmath> #include <algorithm> #define ll long long #define mem(x,y) memset(x,y,sizeof(x)) #define re register int #define ot(x) printf("%d",x) #define lot(x) printf("%lld",x) #define MARK printf("~~~") #define _MARK printf("###") #define LMARK printf("@@@@@@") #define SLEEP printf("💤") #define SLEEPER printf("(~﹃~)~zZ") #define STUDY printf("📕") #define _ putchar(' ') #define endl putchar('\n') #define char_phi signed #define P 9999973 #define N 105 using namespace std; ll n,m,final_ans; ll f[N][N][N];//前i行,有j列放一个,k列放两个 // int h[N],l[N]; // int vis[N][N]; // ll ans[5][5] = { // {0}, // {0,2,4}, // {0,4,16} // }; inline ll read(){ ll x = 0; char c; while(!isdigit(c = getchar())); do{ x = (x << 3) + (x << 1) + (c & 15); }while(isdigit(c = getchar())); return x; } ll ksm(ll a,ll b){ ll res=1; while(b){ if(b&1) res = res*a%P; b >>= 1; a = a*a%P; } return (res%P); } ll mm,derta; ll C(ll n,ll m){ mm = 1, derta = 1; for(ll i = n-m+1 ; i <= n ; ++ i){ derta = derta*i%P; } for(ll i = m ; i >= 2 ; -- i){ mm = mm*i%P; } return ((derta*ksm(mm,P-2)%P)%P); } ll lucas(ll n,ll m){ if(n == 0) return 0; if(m == 0) return 1; if(n < P && m < P) return (C(n,m) % P); return C(n%P,m%P)*lucas(n/P,m/P)%P; } void work(){ //又一个dp+数论 //莫非是容斥? //肯定有一种情况那就是什么也不放 //第一种特判:n 与 m之中有一个为1并且另一个数>2 比如说n=1,那就直接输出(n+C(n,2)+1) //第二种特判:n 与 m之中有0,当然这种情况应该不存在,输出0 //第三种特判:n 与 m小于2 这种情况打表可做(大的表我是不敢打了) //诶不对啊?!n 和 m小于等于100的说!!按照对称性欸嘿嘿打表可做!! //那么现在我的任务就是打出深搜了!!! //可是我不会八皇后。。。 //不行啊,必须得想个暴力出来阿 //放弃了,这确实是个推柿子的题,推了半天因为炮数没推出来,我只能吃特判的低保了,深搜打不出来—— //嗯?打表的时候发现了奇怪的东西 //2....4....8.....16.... //该不会...?!?! //先把特判写出来! //应该不是2^n关系,不管了 n = read(),m = read(); // if(n <= 2 && m <= 2){ // lot(ans[n][m]); // exit(0); // } // else if(n == 0 || m == 0){ // puts("0"); // exit(0); // } // else if(n == 1 || m == 1){ // // MARK; // if(n < m) swap(n,m); // //n大 // lot(((lucas(n,2) + n + 1)% P)); // exit(0); // } // else{ // puts("1"); // exit(0); // } //欸嘿嘿,啊哈哈哈哈哈,DP来咯 f[0][0][0] = 1;//跟之前分析的一样,必定有一种 for(re i = 0 ; i <= n ; ++ i){//每一行 for(re j = 0 ; j <= m ; ++ j){//有几个列放了1个 for(re k = 0 ; (j+k) <= m ; ++ k){ if(f[i][j][k] != 0){ f[i+1][j][k] = (f[i+1][j][k]+f[i][j][k]) % P;//不放 if(m-j-k >= 1){//还有没放炮的列 在【其中的一列】放一个 f[i+1][j+1][k] = (f[i+1][j+1][k] + f[i][j][k]*(m-j-k)) % P; } if(j >= 1){//在有一个棋子的那一列放一个 f[i+1][j-1][k+1] = (f[i+1][j-1][k+1] + f[i][j][k]*j) % P; } if(m-j-k >= 2){//还有两个以上没放炮的列 在【其中的两列】放两个 这个要用到组合数力 // lot(lucas(m-j-k,2)),endl; f[i+1][j+2][k] = (f[i+1][j+2][k] + f[i][j][k]*lucas(m-j-k,2)) % P; } if(j >= 1 && m-j-k >= 1){//放两个,一个在j个只放了一个炮的列,一个在没有放炮的列,这时候会导致多一个有两个炮的列 f[i+1][j][k+1] = (f[i+1][j][k+1] + f[i][j][k]*(m-j-k)*j) % P; } if(j >= 2){//放两个,都放在有一个炮的列 // lot(lucas(j,2)),endl; f[i+1][j-2][k+2] = (f[i+1][j-2][k+2] + f[i][j][k] *lucas(j,2)) % P; } } } } } for(re j = 0 ; j <= m ; ++ j){ for(re k = 0 ; (j+k) <= m ; ++ k){ final_ans = (final_ans + f[n][j][k]) % P; } } printf("%lld",final_ans); } char_phi main(){ // freopen("a.out","w",stdout); freopen("chess.in","r",stdin); freopen("chess.out","w",stdout); work(); return 0; }
那么我就来说道说道俺想出来的第三种方法:打表
哈哈哈哈没想到吧,不过这题确实能打表,毕竟n,m都如此之小
虽然经过了上一次打表失败的爆零惨剧,但是我还是想打,并且这次吸取教训压代码量然后成功力!!!
【本做法是《最优解》】(doge)
小声bb:下边那几个是同机房交的我的。。。
本题的答案具有【对称性】,所以完全可以只打一半的表,可以压缩代码量,我直接上代码吧
CODE
//。。。打表什么的图一乐....不过考试的时候这道题打表确实完全可以 //打表我觉得完全可行啊?? //好啦好啦打完表就开始打正解吧 #include <cstdio> #include <cctype> #include <algorithm> #define P 9999973 using namespace std; long long n,m; long long ans[105][105] = { {0}, {0,2,}, {0,4,16,}, {0,7,49,265,}, {0,11,121,1081,7343,}, {0,16,256,3481,37441,304186,}, {0,22,484,9367,149311,1859926,7525839,}, {0,29,841,22009,490631,8871241,4920673,6224842,}, {0,37,1369,46585,1386781,4589722,4937980,6095418,483251,}, {0,46,2116,90811,3481543,4849973,6633884,9027782,2613077,6420486,}, {0,56,3136,165661,7948181,5240287,474611,4368108,9385491,9206038,6622507,}, {0,67,4489,286177,6791088,1231737,1617529,4841111,3880353,487242,5195995,2835502,}, {0,79,6241,472369,3260572,4596725,5196933,6441295,2787359,1455756,2063843,824496,6854533,}, {0,92,8464,750205,2406143,4513178,9951199,2224603,3749717,2545970,6558738,5762714,5323161,1394817,}, {0,106,11236,1152691,1795940,7949294,7494710,8806407,8097829,2688165,2068609,7519434,253173,9020372,6197629,}, {0,121,14641,1721041,2432484,1371151,9324122,9035499,3671499,1419778,5146828,3460353,3222583,1888565,6003475,4825018,}, {0,137,18769,2505937,9897598,4622028,1805318,2867331,6403205,9250123,8419687,8161302,4558664,8477580,638230,5500342,3936033,}, {0,154,23716,3568879,5761828,8104940,274745,8863586,6250289,2428524,2012510,3788663,1237379,8069148,9108244,3889643,3500539,1416407,}, {0,172,29584,4983625,9295841,6267982,3669376,9530126,2871175,3022327,9138386,127680,2923097,5414399,2419262,5803780,9788047,4488259,1100267,}, {0,191,36481,6837721,9524714,3963222,2211093,6166318,8757286,4773400,5129186,1028258,312458,1562441,2343568,5532700,8117271,646133,8480341,7540644,}, {0,211,44521,9234121,7667306,7634159,6325053,4425050,4291073,7850891,1004250,8534422,4691130,7565247,8700073,6346780,927941,6764612,1045022,1302325,9741285,}, {0,232,53824,2292924,6532,599243,8624322,5421973,5443921,5173751,2351512,4253223,2697064,8209054,8325694,6789132,5560097,7588871,8509758,2364093,3122245,1370140,}, {0,254,64516,6153066,1238149,1052338,3138042,8584489,8996422,9891870,8786903,5918737,9377230,6889513,5917214,4305635,2374478,6620479,9213663,3670425,4907522,6604014,9364483,}, {0,277,76729,974399,8348724,2910073,2412671,4921123,3173612,9484752,2747626,3499212,3523185,7822629,3609921,8570030,2558878,5555267,8469392,231146,8307877,8886995,9024309,2003086,}, {0,301,90601,6939455,5075434,3411200,1291047,9037866,1769423,3261966,575107,6179208,7754709,4862364,5617602,8148738,5137658,5104877,2710955,9320621,4127307,6354446,395519,6489982,944592,}, {0,326,106276,4255732,7003138,7531596,3377894,2965160,8373505,5715825,1726546,3405817,9515859,1694097,7614075,2462348,1241837,8758266,7657540,6918059,1325614,3004408,6530639,486103,2778395,1743165,}, {0,352,123904,3157665,7357059,7930730,6912840,5506091,6436111,4729430,1943824,5447348,8748415,2030442,3345253,3393249,4381707,6057337,7191293,1749045,4672834,4535753,7840456,8280782,1076527,1153703,4687897,}, {0,379,143641,3908984,3551070,405935,126705,4780575,4343074,1677434,7126297,8298497,8624787,3120773,3411423,9710429,4342460,9179829,9977544,8665595,112833,3850840,2528011,3250991,406373,9169693,6445763,1087176,}, {0,407,165649,6805027,4554854,8813349,3432561,410192,7211557,2099069,5990575,1803948,3305163,7334501,5040973,781497,7706591,8517588,8143449,628351,3803014,451701,662022,4066899,6381147,5266356,7022915,9011919,441262,}, {0,436,190096,2175197,9145485,231940,7903341,3349006,7176264,5466093,1351278,8184468,907424,6655876,2937650,1157193,8653480,6892420,5280371,4027065,605667,1670711,58412,8920782,2979534,258048,2139147,4620734,7465650,7979452,}, {0,466,217156,385401,5111335,911577,4424624,8551465,46744,319220,4550015,8006261,8085918,4220963,417880,8751115,877111,7350396,1316046,5113191,988868,3716396,1982836,4476029,4159328,3826876,9418782,5116397,8043664,5407261,7079379,}, {0,497,247009,1840741,9478813,6375561,8296681,1604872,5154167,1415380,7277685,589600,7994480,9229292,3921136,8163183,2668610,192513,9822003,9673281,1724711,8914644,2947638,1767870,8103863,6161583,1933467,3464828,979640,6173616,8464606,1998002,}, {0,529,279841,6988187,9835394,5048794,4579609,2115606,6246258,7413978,1896982,7662828,8456386,3023723,8772115,6921504,8487091,549619,4134129,7330863,9543284,9864059,7225329,5388245,7830569,6993286,7937842,7914074,9574365,4005184,225849,4675415,8892716,}, {0,562,315844,6319394,6823998,4075260,4381576,7636822,7625665,7923187,5134988,7873885,2130784,2399208,2088878,1587784,8068849,1974180,5986615,1040264,4156443,8313633,5999075,926705,6627498,4934388,6011934,5755130,8136862,9932856,4978100,1362610,5481812,9287523,}, {0,596,355216,373528,7887244,8681665,2885482,5596578,4563750,3794532,6866448,7980843,4977526,6374533,9328930,7525327,4256464,4106706,4065332,6046454,6061586,1796255,7505751,2586370,3314086,1533733,3790105,8351693,1195277,5231411,3890038,9219596,7014969,5236643,3903119,}, {0,631,398161,9740209,2342138,2652575,2022617,4568204,8142163,2034753,8682341,1078401,4272666,5856153,5078808,1220989,4473858,7142040,7445352,8453110,9092483,5891139,1227921,7195755,9435007,8879494,9526121,4794430,7551256,4885739,148836,7756178,776657,2600122,2017763,1658727,}, {0,667,444889,5062760,7868112,7319872,2186764,8993613,7544274,9150453,2735507,3133934,6294265,5313359,8882198,7250085,1794882,520425,4197201,7277279,8918320,7634433,9607414,1805175,9730152,5508902,9926300,2338843,2036039,1339706,649066,2890713,6521726,1543439,744820,6791082,5790776,}, {0,704,495616,7041087,8494580,49920,5587137,3431546,8245008,4022531,6815517,9323761,8771432,228044,822133,5585384,7453132,2579888,1378008,5200095,5003930,2315336,4606756,1475070,7502248,7121475,4103086,1489162,7100271,9988604,2386808,7779530,1401115,1693564,9814022,5793399,3497148,3232150,}, {0,742,550564,6435135,4175617,645791,3102321,615497,2956156,8002681,1784002,1414518,6714371,8044594,7823456,7389239,3411358,1150198,588732,6419738,9426199,8758003,159695,6941185,6502444,8386784,4277207,6685258,632626,5323751,7577620,8051934,5367899,8642099,7283905,2835241,379614,1236180,6832304,}, {0,781,609961,4068110,2042940,5487991,5626409,6716085,2262855,3273314,9256600,8400027,1847594,1013132,9342714,7263615,3080473,8452885,4860085,3136219,3293263,290910,32438,7762737,3202408,1299255,300647,8822873,9882385,6258162,8032714,3115048,673683,25695,1456637,8230454,7158394,50896,3329929,7348287,}, {0,821,674041,829926,9430269,4722430,656088,7073239,7115853,4494743,8575349,7956515,4023524,3805859,5758669,629480,6240473,7834712,8689103,1446636,3549995,4234723,3236393,6028565,7384694,3913146,5318941,7981992,4241601,4608996,5903930,6854580,2304827,4244861,2002459,3203707,8028749,4174471,1700044,1646307,4101017,}, {0,862,743044,7680688,8764882,7487833,5452760,6891349,7367252,9137868,6325340,4077979,3736534,4082072,3827425,1474531,3984360,2186842,6318454,2840718,7335195,6804540,101777,8035090,475506,7491779,7052362,565144,4700867,8901482,3896178,3801429,5057288,2887606,354010,4708223,8620407,1294372,3126478,7925039,4180040,8533166,}, {0,904,817216,5654400,4424401,4166605,6654775,9769667,3826834,4774336,7359392,9137670,9114854,6257318,4488835,3253620,5265174,8554030,5435122,6773138,9067528,751854,9394321,9694630,5642474,461068,1979986,9041762,3002962,8349697,4858606,4949712,9286008,2568024,3925062,7192120,6835821,1680558,9214368,1556039,3126501,6943447,3623034,}, {0,947,896809,5862493,1659987,3057039,4240263,7978227,8770483,8813119,8972915,9307471,3991116,5274383,6915771,1214412,2768529,156616,1058662,3968133,1092792,5422788,7603280,889744,7855422,1783013,1952231,3826341,6019474,9992513,7899870,5254155,4404416,992114,4072678,7393372,5241681,756277,8613263,5857546,5625300,5023940,7715491,1743658,}, {0,991,982081,9497713,7689021,1815955,8680369,2949193,4157012,9010853,4399385,6142027,3989529,4174796,6167874,4141536,6519590,804612,635191,1834418,1704621,4631934,3463065,2347221,1387890,6436858,5934496,9969357,1344210,4946069,6382436,6746457,3457686,1868137,3849803,6944004,8643932,816181,3035549,2650608,6508484,1482093,8713148,3351219,820524,}, {0,1036,1073296,7837991,5063246,1620053,6774279,6593972,7492871,4998406,1061853,8328631,8907758,9656882,6785917,5361787,6323093,1446764,7631368,9073313,3256392,4877142,9952342,4930970,2392210,6140629,9589630,5258353,3944075,6028410,3271303,2185759,4149541,7237809,259761,3877973,6104702,925887,8776948,4673262,19537,3697675,5394710,7239425,9583917,6988796,}, {0,1082,1170724,2250349,7420433,4357392,3686111,2171232,5883338,7298920,4927412,8950023,5709960,9094223,2169164,8762088,7119565,9722142,1785661,5857976,3563407,1599967,8001945,5024815,4696211,5376681,7644577,6795010,2963491,6707875,7637009,6945545,9132553,8392437,2466421,5665347,8987652,5306266,455212,9718713,4562979,6979903,4434492,9788794,8666817,8535562,1794908,}, {0,1129,1274641,4194950,7730964,399115,119087,5755390,3990188,3725369,5223646,4268398,9047382,9666280,2213090,2539531,9120442,7198371,129356,4915405,5016416,733683,5548786,4628231,8081575,4021802,9872419,9937865,7767116,7561002,8069421,2924767,7467423,4067530,6315948,7462118,256829,7232801,4202263,7701726,8674495,9002531,8083798,5720358,1820748,6443420,4540706,7322175,}, {0,1177,1385329,5229319,9152219,6729902,201075,4929178,8048178,7712427,2929326,9124092,2090072,343251,8820527,3593284,8775404,7761924,3685888,5211143,8801517,9804946,5075771,2766734,64478,8117625,2313480,1365375,4830142,1881568,1961335,1445934,103736,5512815,3328782,2827544,1765301,7205399,9261070,9959919,2555843,4147110,1412196,2890082,9325513,3814007,8648589,6821157,1246844,}, {0,1226,1503076,7012492,8607038,2547724,2673323,7482655,7694697,6043243,2405259,9237362,6311262,6946024,4286667,7775104,4308567,7007185,7271949,8376898,9306637,5073503,1606180,8367143,6476566,3902553,3958646,7357498,2640365,7551824,198441,6316761,1126619,599148,1560426,1402874,5392880,9055565,3660535,6322953,6071677,241856,5286775,2063850,1483275,3849507,9189467,8971254,6730235,6908449,}, {0,1276,1628176,1309390,3204509,1990342,7321678,404564,5881657,6443500,1416086,8600641,3622091,8859391,2781343,327193,6620821,8969819,3729814,3541098,3749433,718262,2741462,2854819,7462457,7385580,3471529,9211584,2353006,9287642,8345321,2090564,4068051,9815341,847010,6971920,2121410,6672886,5409244,9513650,634082,1450018,5455649,5282922,2316759,3133783,2673486,7128650,9347799,5646557,3948491,}, {0,1327,1760929,9995121,9624069,1525096,6503407,6284693,5104055,368275,7545579,2072636,8334522,5596835,5535739,6430060,9107236,9197089,7399351,6467350,8135940,6158894,180586,3523835,8369730,9472638,6558972,5540299,5734140,7614083,3022074,7815980,4789882,9590192,1924637,750366,5385885,2405259,4417306,8852294,3087410,6020230,6748548,6630379,347873,8057589,266151,816552,9660655,763618,2458271,9715090,}, {0,1379,1901641,5059696,6586641,2858238,6105546,9234884,5550513,617874,7900464,4108567,5998873,867767,6838348,3010462,5012385,9378230,1472249,5423326,756407,1923309,562328,381464,823812,6339105,853677,6104965,5118950,5013180,3908502,1625054,1604060,7440064,3388842,7078822,3691131,1427290,3384566,4752483,3779774,3132418,9681472,4696811,5256269,1726835,8511022,8357405,4882742,1696681,5732798,8801599,8332250,}, {0,1432,2050624,8612349,538267,1098478,8578921,9698259,370359,1669104,1781092,1056156,8371827,1159387,1177470,8001189,3940896,1805358,1880174,6573748,60917,132337,9812494,4504389,76171,3031916,2348209,7887364,7216330,5976348,5696404,1794669,3726596,73425,3866709,5618978,1301168,6512591,7956618,930011,806663,7925476,2360281,2403681,4053874,2457065,7984220,2000853,8675018,2536314,8377134,766511,3321106,3130568,}, {0,1486,2208196,2886460,4675324,2456531,6816637,2888733,1985621,6005559,734443,9707905,6555459,9930864,1472160,2168367,4109559,5641428,9108628,9165239,7155589,6732589,6337452,6747771,601796,1038846,2650864,3617549,9794413,7196894,1182820,7598325,8301504,384638,2792553,8848549,7985549,2260938,4212207,1463427,673203,8853189,6329451,6870089,7035350,9703428,6549938,8568735,5939797,3061948,1917641,8296524,2113269,5306124,3014986,}, {0,1541,2374681,244136,1442174,6093809,9801074,6067511,4081910,6872307,8618237,3470660,7331969,4769433,9972164,8094183,1348554,9779453,1234958,6296004,4996247,8682481,1790679,7446346,8382062,1080087,9079811,1082676,8540846,5059431,8835674,2563422,2178093,8765945,4127712,8517558,6670161,7186712,8559012,4751376,3437174,7571753,5263919,3373311,7824186,8347765,2190905,2515289,2095657,8397317,2116527,2520931,4435309,7027661,9920755,6370571,}, {0,1597,2550409,3181179,8634484,960910,9047685,7117914,3887319,7314092,6112384,9567984,160190,8716815,8060211,1267835,1398788,8462504,95972,2103546,7309743,2789446,1839728,6862872,3641260,4892513,8600870,8553710,9483679,7572217,1628630,2092435,6535113,4567107,8737267,2920322,3922761,5937456,8633309,7882580,7391281,2346059,8644256,1648443,7632579,5165989,241138,3743857,7428918,8392723,1003469,6440877,3788122,5041386,8577543,2857694,8262333,}, {0,1654,2735716,4332036,9244944,704669,8034490,6072018,5429699,5269233,7435137,2065390,3383984,5022371,9095940,3686031,8442556,5880659,4439638,12451,6340701,2582955,6134414,7901076,5555375,3504516,5376916,5737504,1137681,5261285,3238561,4567729,3477517,5228619,7059891,8103761,7366100,1127368,7288299,7869297,7379323,7747283,7753504,7248659,8530461,9111661,5137105,1105434,6871415,446963,1145657,7791629,308179,2094048,7045609,4882102,406137,5827116,}, {0,1712,2930944,6474785,5189281,8084546,807898,6007144,7571223,6842799,1415396,680081,1838117,9951245,6446394,4883219,3209342,2786672,9743542,2902664,2633522,4680263,8206822,1247012,5023227,1112444,6419642,4728316,5612791,796512,2534034,9522481,3974446,2376410,4997395,2021414,725321,4400048,7991978,9432150,6632485,3462589,9680465,6272933,6076583,1735052,5857550,6419719,323456,9505742,6956806,6640426,7863088,9359090,7613963,822530,7738494,9829444,8576600,}, {0,1771,3136441,2536319,5054202,4937245,737333,4560726,5984740,3868479,5214439,6315661,3360894,8383331,7653840,1744580,305460,1668877,9029587,3938145,8125604,2449388,9452636,6698371,3350872,5521789,6600082,7779002,3828195,6431903,4889776,1390423,3425884,8679179,683113,6179312,3642815,1449260,7375458,7733785,3494366,1879391,317262,9607488,1458267,1595271,3976873,558589,9571732,583046,5498811,6994919,3129059,4783858,5611616,7363853,2977551,1481482,7785865,679516,}, {0,1831,3352561,5597485,6010744,4677706,7539970,8396270,486103,1553050,1859841,5144386,9458925,1126135,2049213,3737742,1464612,3469663,3816857,105532,2497093,3852994,8822861,6298871,478659,3805857,7673570,8016997,6243193,3223166,4721646,7242773,302610,7767425,6331432,830361,4248683,9867970,7679375,1050439,8233501,9726841,6099260,9578191,9871361,3110814,518785,3103571,2076170,420958,6407176,9017694,1574679,9971828,2360323,5105499,2130251,973277,1352716,5593601,386531,}, {0,1892,3579664,8898502,39110,1738065,922473,8513135,4384051,2536732,1462715,7382157,9452937,9426428,6363280,1491308,8142018,1732659,8257095,2847224,4026800,5148105,6345807,9011899,2970746,2588374,7328378,2746951,6232590,6816176,5657458,124615,9985798,5600247,3811781,5843234,7166795,2030213,1244362,1146280,575799,1533738,2346026,6346996,9152352,572091,6641888,3511910,5598793,5703990,9289670,5877032,3580050,3658073,146601,4434385,8685195,3760688,6680108,2006724,7892218,9619483,}, {0,1954,3818116,5844307,4613671,6335345,9814723,5540292,2337306,6582542,3703913,3075770,5497582,7124466,3307789,6865778,6087111,1391870,9597429,5201638,4930135,2768211,7830069,9871103,7854763,9998940,2353774,6440309,1935093,1122169,9990422,4326507,5351066,3970807,9928086,9420738,3131755,9114575,6905696,9148813,2410907,4160595,9906610,1109016,8661996,8049409,9829205,7872049,6608571,7220987,9308457,9028764,4262137,8841527,9224638,1512212,2546091,8862073,4995859,2722172,701576,8724368,7164400,}, {0,2017,4068289,10018,7999631,3640326,8621544,7933258,8085998,2268496,8228348,6400168,2577796,5300605,9792177,8188628,7082567,173468,6057706,890163,7603919,9276126,9521318,5986855,8837842,8818620,4061991,9599248,2203825,168609,1355943,1789387,8824445,224201,1439113,8783268,7057919,1613555,5782732,9346143,7558950,9893126,5490476,4031725,7490888,7542202,3345756,6972268,7460528,5439260,6646387,6127626,9436616,9685236,3943576,3766369,8691746,4034269,2005288,5737106,3557976,9419417,8042195,2223922,}, {0,2081,4330561,5146514,9314589,3903918,9190368,186062,5621096,1268790,8086891,8953492,3898905,2717557,9761042,6842016,8611069,9698197,8911621,4749822,1296914,9636622,6962939,1925976,1326056,5919825,218249,5612440,2685077,2220936,1549021,5083604,77216,8963604,4040648,2955097,5603737,5066020,9448973,4785009,6393239,2194008,4698896,1475179,186537,1536471,4813930,7104513,3204646,2975025,403126,2752276,5743738,6582913,7835004,4404272,2001242,1854688,7442368,7748495,2452499,9598210,7403523,8502440,8037386,}, {0,2146,4605316,5186213,3511643,4500473,1358064,963736,5777182,5056664,4388234,7411801,9756158,551816,7195194,7390293,3257344,6264189,6264816,5757084,276235,2241198,2960850,6542911,1848179,5501644,990092,1639040,3028281,7054609,3367597,1067225,9061795,9122990,2283218,7925012,4291895,1597917,9813749,3107947,7227807,5067167,4239448,7619672,5608334,9447684,6049437,8035109,9540397,404421,8326768,9898992,2587308,6183577,809780,6496999,3195634,9949881,1501433,4082297,2904618,3049332,1091937,2432503,7974146,7860930,}, {0,2212,4892944,4248697,1442553,6279602,4607614,5143819,1906061,5179531,5273070,4161162,6193089,4215676,2630326,4242194,6462006,373373,2108069,8518508,2870341,4449242,1855623,4704656,4821497,9323420,2770377,8319983,1157577,4691533,554655,4617709,2595436,3657251,5540718,6423400,9721897,8654205,4098262,7223357,8324649,5728384,3265119,2128978,3205216,1772849,1248049,9629450,3878550,9969479,3466657,8547837,2287695,9982152,4585216,740338,4286502,1961266,897739,2072429,4479228,6241156,5513682,3372367,5675424,8442659,141372,}, {0,2279,5193841,6646616,5162459,5195878,1191559,6525224,3243628,6156261,5301799,8416179,1421224,9903573,7446611,5227748,7986940,1046590,2161247,3330279,4673157,5315301,2981080,828238,9373989,8310004,7528662,6574116,1311713,1183673,4489105,6917104,6005794,7519341,3270118,6622439,1229091,2050504,383313,7124834,7202136,4838612,3009385,7625141,3870248,4998394,5899788,8583052,6728031,5208135,6424082,155139,2797866,7978028,3241566,1120595,1729037,9358618,25520,7602164,922964,2199489,9766665,4505843,119321,8913848,3289290,837664,}, {0,2347,5508409,6891655,8639765,6020303,1227087,8849975,3019619,479823,2324273,813693,684636,9664393,2281111,9799383,1861489,8173565,1156834,3207476,1540417,7836440,4704059,9955860,5640434,7107467,2218670,4504156,6078195,8521617,2856147,8759740,7314501,6251744,2330607,8037438,5363609,39525,4368760,218019,1669916,4228249,5593994,5328363,8844734,6911551,9484146,8956964,9192785,2722180,6623508,9888794,2255037,8660287,1144547,676440,5046365,1616885,5303720,6298983,8919928,6328707,2384086,7552033,8359612,3607250,197179,5532432,4434930,}, {0,2416,5837056,9700510,4037563,8143535,5913943,8730728,666799,2594412,6741464,409477,1356868,6511321,4033371,7945613,5523202,873645,5719961,155605,9434909,4167343,4718581,57051,7369210,1981846,8975827,6318393,6645321,344083,2541913,8444172,6187666,9193500,964771,8629508,7321648,2312105,8087876,4683563,1697914,6389385,3370322,3247920,4995729,5071733,6076360,4683559,6907120,5843314,8979065,9356278,2040395,7709303,4459273,690941,2210727,6334057,929056,9084727,9190033,5175376,5584251,3933759,813746,5811406,3951111,5748748,5185957,1575105,}, {0,2486,6180196,1089,3735410,4170903,5824829,4307275,9569221,4762916,5042294,3606240,7004124,6793284,3906324,3641318,1325220,3145651,1787970,1157066,9677195,6362512,6101261,1400713,3286285,3097295,121776,3529068,5882086,2847378,6332859,2086197,8346380,6920659,3101435,9716362,6786396,7753543,5952429,5191518,5669215,3194694,1372784,2569421,3104889,6296938,5647507,434484,7675944,7836906,7639527,8292864,4308198,6714699,7831325,3379849,8097009,8881577,1017488,4772650,175662,7712563,6294159,6420561,2004927,8494068,8550793,297163,9232299,6856851,6590453,}, {0,2557,6538249,2938560,8263007,297421,802814,4568357,9639091,1004220,5292476,8686349,3722631,6920476,9292695,8440957,3140766,513593,2895445,2745389,9476676,4188170,1288890,6900528,562167,7687135,1457457,4680927,8127595,9326355,4373028,9215218,6362648,1359139,8100743,119599,7008933,3485797,4503254,6917405,557614,1880109,9441413,1895409,4788306,2370033,6813894,690305,8299130,5581252,6646242,4441521,7666351,64894,6388127,7784156,5432797,7516405,5819122,8717501,4364776,8645812,8919629,1243961,3563811,1390279,2362041,1664186,7427640,8753503,3985700,453197,}, {0,2629,6911641,3881867,319444,3450503,1456370,6777913,2988125,3539409,2329743,1439070,6855501,9276082,3072833,8975063,7149645,3142386,5714221,2324026,9068171,2831408,6664558,9582367,3682479,393581,9813267,7256060,7666437,2963701,8442496,6898424,6236421,6317273,8093484,2735205,3159540,3685805,6023001,2576397,4001623,1349868,6567386,4873454,4580534,3202932,5647847,1920202,3948902,9822331,4077993,9412145,9607466,6562292,2034851,3897555,236753,5620188,6087552,488186,8064582,5875391,3403219,2810016,1981690,1240705,4202528,5673964,6146000,63908,4241500,5143945,3677205,}, {0,2702,7300804,8429958,5054303,4011794,3597364,6792463,6546097,3632636,5502349,2723876,5039476,9978326,5554201,3971600,5185229,4852514,6548617,3905000,3507902,8086632,1796611,8737682,713877,6600986,9227582,4603718,15692,1700946,8472136,5211553,3302087,6328500,7831318,2820980,3661730,7876298,8984357,933662,4790408,756184,7186407,3034319,201035,1153497,7811373,8949632,3933450,1168300,1704989,2460383,7356310,4092200,9452962,8805654,3304842,507243,7286098,6089623,2013243,6067270,9958271,966142,3348319,7528561,3718877,7825060,8860104,6289012,7448776,5807323,9739935,7798759,}, {0,2776,7706176,2418373,6790106,4691434,6672884,8284577,3487648,698070,4080713,6739505,1104065,9111000,3451452,7175745,5886459,5284301,9635136,7396367,549637,8909832,1087650,5417669,1922110,6541706,1203276,558742,3654434,4528519,9902794,4384475,5752186,4996807,3819530,9837608,4919770,291588,8213121,2931555,1912606,9209050,1781047,8816760,2542703,4732447,1696474,860470,6541750,5373952,2567219,359444,3411646,2552610,3162970,5376153,6049846,5660112,8159751,7498195,6509351,1549471,1323999,6578071,1018191,298580,2027005,4472449,9693990,4796853,3613387,7254224,285664,8795751,7788189,}, {0,2851,8128201,1925679,2366792,5941833,9660481,3917159,614029,6684396,8232857,7297176,8261441,8604177,9275034,2129550,3985857,4867924,2923585,1780161,4191228,1417219,180705,2887501,2577225,9940544,2502422,7614782,5573717,7739832,6586583,188015,6098026,2169532,209167,8663341,1452274,9999594,7614703,7979273,7728382,5243833,3334907,8333374,7912646,6337398,3168241,8970182,1698490,3348933,291858,4155899,798870,3398969,7229272,6840818,7921856,5129211,8329514,6816962,6241029,6284092,8464324,3416503,2063735,5237194,43809,8301161,8765925,1774831,9859479,1558015,9961142,9648970,5696284,2261606,}, {0,2927,8567329,3280265,1292696,6275840,8782505,2216183,2486600,1408895,6162932,1409296,4032915,8255067,6735672,2622340,2783974,8114265,4138570,2481247,3915108,4146564,2113813,1826836,2449569,8480645,5479828,3210305,44768,4494631,8688583,3967694,9067058,7281260,9242136,588057,1035971,9583564,5426001,2543435,7284873,1156851,8194650,1469463,1850955,6501813,4491242,6781070,1122190,9743038,5004607,6716975,6409144,6912800,7157991,6914909,7338529,1651163,3392565,6463712,1739233,9715659,8349890,1652262,1338523,4231508,7034777,3233343,9012449,4712533,3277310,3967098,7670307,4863089,2484211,7846544,7917881,}, {0,3004,9024016,3067038,2888429,2110815,5383301,1990370,8905320,9567392,2001478,1831665,2954931,1832889,7386885,5386226,6775553,4328457,3593698,8009210,138049,5271153,581009,6454709,9476760,3540731,2643226,6712384,6461968,7801704,8799913,3599304,512793,3319185,3209942,7002550,1336301,4709369,7719460,4564683,9428370,5624329,5392838,5089351,9769206,6313268,2933759,5619050,196838,3381316,9942971,2472990,305364,5865603,3001397,7979993,4927687,1340618,7314538,5314672,9482533,3854388,7106468,8511905,229280,7250747,3871676,3975071,6409602,5431447,7016157,9856410,772044,2561099,1385208,6728944,9698923,5082986,}, {0,3082,9498724,8134236,612524,6408069,399235,9042974,3961506,5813233,6799269,9237186,9257400,9925103,128313,3955585,3449201,9181007,1587597,7784031,5948522,656859,155195,6546925,1877099,2900932,4346349,8089689,2978116,1945731,9803065,5842338,9201014,168128,9554649,9636259,3700706,1740223,1335967,5432833,7983031,3399649,2036429,4617340,9730119,5637317,5497265,8201923,3547180,9841094,2536352,48329,2278610,8723055,3102119,1405215,7835015,1283322,3660841,6811771,1843356,9646086,502269,3052020,2334170,5170551,5528625,8374390,8220426,1141895,1165801,5476758,2828073,740142,2233145,3760294,8000477,5417268,6330631,}, {0,3161,9991921,5600439,3760395,8530471,8879022,5517711,5923659,7323152,2393426,2399876,9764319,294737,3925717,5437954,9742387,3329809,8343122,838255,4636275,866373,7375126,4741929,5731928,8743608,6004206,104733,5378744,4985704,2306295,6644155,3672,7153421,1228547,1769335,8801361,6969261,3977702,5129298,2540823,3421121,8580848,5154730,1006508,1194960,1762513,5077014,415406,7640470,4994620,1945746,4788750,9126816,7094191,3980488,4126488,432997,2176201,4354051,1999728,8095699,6110024,9511045,6606110,7529122,5733695,9275405,8468260,6135758,5525935,7313062,5835970,1706909,4150470,5430622,5666065,2740470,5618484,9694497,}, {0,3241,504108,2861481,6730838,9511945,156348,5833559,6195786,8927764,8948364,7268164,4125610,2235498,6158635,4510070,3088954,2815330,8596370,39647,1775273,992951,4851602,6121130,1577135,713204,1774261,7047337,1968684,1429873,9054034,3478204,2087093,1373579,2850276,1018965,6666274,554693,4241006,9703605,6609169,9339407,5627602,1767643,5987113,2159633,3292130,3910680,4038961,3985010,2401422,4781831,6601003,2031785,616041,2664191,9305115,8471487,2888962,6821498,8816835,717661,9092379,1163435,6630001,3446661,4566139,1699862,3296756,8518779,3352890,1746205,9856683,1825153,5179655,7687795,4291428,3357187,8042806,8972697,8304147,}, {0,3322,1035711,7597614,6056364,7436600,1527491,5608007,9089822,319124,7206426,9025470,8971874,4140792,7323147,3490047,7561287,5695511,7941780,1358522,9573334,4927234,3283620,335063,4403912,5923243,5363940,1871273,3972038,7563300,4238209,5976085,6872388,1691518,85615,6461924,4232732,4275918,9953621,4453603,1127680,1899623,4029151,123450,4248755,3701034,4244831,6148901,2304448,9322394,8234057,1206834,8698381,4505343,6144015,5760334,8187218,9521251,2887427,8818589,5753076,3262436,4781532,6356851,6422472,627897,1849807,9611259,8852399,6347115,8905505,191606,6083547,6293418,9284888,4703191,3549093,6558801,3788815,1870908,7973283,6547761,}, {0,3404,1587243,7780762,5396606,6973241,6938574,7882389,524996,6525592,9117962,9164171,734376,9284344,2190551,1710212,2664599,6605554,4116284,5898778,8094094,1034201,1385890,2336850,3203392,5696721,1492132,4582609,3843017,3170238,9552307,3928014,7650337,3999824,1772297,6662702,1877265,1626926,2745710,6645078,3848120,6040635,1086219,226363,6798810,7481187,264783,183567,3190899,9377249,4920469,2164394,2701888,5629447,9672778,2329502,7382322,8092546,6098643,4871107,1502801,5478787,4771700,312782,2598666,4278636,9379357,6091237,3360772,877934,9888767,5744850,561692,2190045,8467550,1597481,3674771,7009285,8934031,8164517,7422590,8676115,1476486,}, {0,3487,2159196,1681730,8696400,5418505,2310348,480247,483460,9945832,7603643,9270689,9552279,3216983,428017,8092693,3600996,6922583,3049036,3451967,3196149,5038806,4347290,5252287,8620146,5525677,8009767,6227046,3212632,1381084,1923978,3334173,386547,7261535,8375979,3005119,8670419,7642156,8822210,621147,8142157,2212784,391229,9213847,7254268,6780251,6746639,1536509,830227,2552456,3163772,9001308,8566912,8595077,1864797,1796364,7986594,4882732,8839663,7306365,3658710,3792849,5365283,8567010,3794147,663593,3998974,1626712,4759707,9355499,5217926,1621855,3224472,7969921,157575,7179998,4583048,4869185,8976381,8684426,5182217,8516568,3036607,9908975,}, {0,3571,2752068,7877557,1712660,4980795,2074605,3144742,1473535,1005973,7404936,3714386,4822718,6450740,4455250,9775382,4130202,5259547,5991190,7716008,9835661,9319311,5661733,3704634,4510502,9525255,5117819,9385931,5218803,90978,7459395,2726207,4724790,9939547,3098124,4994826,1291902,8563192,7880303,4598449,2981964,5163250,5463956,7539147,1615101,700508,1744725,2557966,7727638,2279925,5151079,887910,2909948,9130875,6406619,2440447,3251608,8696605,4717793,6982792,9575509,4083627,4975037,9740304,5028191,5446882,7500480,5244973,5394599,3920242,8098712,4993647,1391954,4144877,4692822,2484631,8272535,2287969,2301224,7520629,503469,7122139,9990712,4315291,4631626,}, {0,3656,3366363,5259148,2116471,7602054,2360231,8057040,9241688,8331734,7949060,1544031,818437,6224081,2459628,5411257,9081307,383941,999962,6069396,9580001,8360706,208559,4612668,98994,2767427,4960081,6066099,8444806,2375149,5886543,9594793,4294831,4925748,2438710,6978792,1854256,6342555,651649,9795483,7593587,1708102,8261382,9960376,6288819,8932429,9518720,584239,4005096,3213452,8422332,9809734,317993,9059105,5488552,1007909,6854764,4584128,2983264,2812852,2791890,6798358,3968488,2448946,6900464,4363430,6077344,6126674,9679856,9809067,4539062,7020641,3587835,2294941,4280544,4304461,3305059,983494,5503789,305092,427378,1855564,8889082,9380504,1405336,4017954,}, {0,3742,4002591,3038645,8380019,4477712,6385935,8567179,7581504,2577972,2085027,9468427,9151579,1338663,2044800,5725287,8865945,4757917,7371414,3775905,4329893,3735956,5134976,3426812,8399333,164529,2346031,7386417,23271,2623295,7415692,3905997,9448803,1051143,7774593,2119054,5435660,3357950,1450770,6737923,4404805,2664585,9276091,5345238,916053,6117581,8028641,9358320,2770223,4095967,7883879,2106461,1979070,4785420,1290050,2311015,3230941,9606636,809167,6784110,8059621,5394143,7641421,4408946,1564168,2580087,6370796,7805802,6446704,465717,483843,2178088,582570,7176907,4645375,3003783,5778261,9798910,3595375,2366199,9594975,8829368,587797,1946770,710182,4034665,6681666,}, {0,3829,4661268,757185,7659606,7710711,2052253,3722988,6877021,5123832,5579566,8473020,5757043,6698740,8803633,6004079,550174,2495552,4793755,9313370,1984992,3808952,5813820,7953358,541465,5733637,2157904,2747321,3757494,8056897,1738796,1451823,4387432,5027823,933451,7370654,930795,7617074,4896303,6800831,8049569,5925289,7056553,3776273,563177,3723523,7095954,5198142,5871028,1007401,6018676,120911,6685850,5464942,602992,150745,7054899,956770,9471453,4731604,5993875,8328865,392054,1404211,6726015,2504794,4756060,2341663,2463137,5022264,3378606,2301217,221492,4456835,4411707,8905866,90964,8537423,3676539,5109577,6072535,7204170,4313610,8452500,2182632,5532508,7028711,6120088,}, {0,3917,5342916,8292586,2889058,6337252,6740961,1375123,2102441,3675495,9013671,8428435,4754969,4424766,4673714,580992,2966189,6927306,2455382,7020035,5428551,8728124,9946480,8877526,5851608,4387324,2572347,8772977,7381726,2678041,5953778,3353449,4481322,8926699,9013490,7449781,4544875,6468470,6079673,6563978,977130,1507463,2026851,908399,1394500,4721683,624552,2736729,3515466,8133207,6558197,2128206,5568486,2467294,9221869,4208842,9555601,3311189,6318231,4898160,9096645,635609,7746936,5985314,2000981,9887962,6808545,6247428,4866541,3771290,8715939,3249323,8872669,7431798,282203,5332122,7169725,8859447,3572671,4989790,6917625,492946,1997169,9838103,5368029,4633077,8210019,5737493,4442457,}, {0,4006,6048063,5867285,9300381,3401486,4885863,3240155,5949878,8248445,4999752,1083347,4468310,273650,1673519,6173085,7581844,8324162,284803,9645263,1286621,6376719,2863875,2096161,9924622,9603150,5944565,981949,6408610,8434594,6563804,5527428,4068023,7845029,9677324,9315789,4610884,1688591,1371258,8121895,4744826,9722474,9422063,7089465,1802919,2147402,3858866,7359877,2381808,4377294,5429957,8302244,272446,4806942,3226428,8087034,2758149,5616040,9561727,5434202,3020525,2999026,3843570,8624997,5086838,6924000,5371687,3749942,9128862,8683418,4356388,6881499,3584690,3061742,7511957,323276,3428311,9162144,3680158,5331484,7095241,5527381,935779,7724939,6563810,9368140,2265376,2346520,3417319,6263193,}, {0,4096,6777243,4056096,590959,4949888,1105027,3636371,8768455,511547,345070,1226963,201927,5845768,8839833,7721451,3358424,5832410,624467,5924463,2393546,3895462,4230196,881506,2580678,7420320,2131341,1580567,1983813,4865068,4716201,8768951,9989617,8639202,4074596,3268845,2325433,9977836,1084614,2423120,3712278,4582256,9427095,4018322,6173755,2153724,99598,1329833,789287,3125519,6585239,1494370,5087143,9090239,3601355,8764962,2875831,8129164,7740121,4143593,4084335,5292416,9389965,1673747,3581984,9576407,6007843,3081528,5577999,6272480,7306484,4485414,2709661,7912963,1709385,6250960,5497442,4521578,6801681,6173726,1928694,6443834,8344390,8500001,8245012,4422623,4511200,1472202,4468335,2686015,8774754,}, {0,4187,7530996,3794328,4958514,5874155,378347,616987,6572539,6955183,7163759,9774915,325147,2670294,6565,2889319,2849722,7006015,1520822,6504281,8123840,6470294,2320069,846545,5947950,3722080,4229050,8595899,1792902,3844676,6271711,1524153,7545540,5885123,9862643,6854001,306356,6213845,5630134,6629585,5254143,1957737,2088969,2616877,5926182,5880212,5247452,7579273,9197208,6453945,5276656,7270883,1296604,1923554,812748,2093439,9969116,8678173,6875243,2338086,5659789,6094414,1623284,691436,20056,4226357,1275608,581751,1745538,9925296,2657330,5777994,4694013,6210094,5207760,8372214,3352541,4617658,1707577,7996014,6085146,5188148,2213700,5154638,7072316,6966245,4395156,7083570,6350100,2313428,4234752,2428087,}, {0,4279,8309868,6385858,1229053,1569311,2849717,5845809,1691895,2251104,1389611,7992966,528896,968990,3743631,7503346,3369313,8520147,8718262,9022929,6709266,8819531,2851485,9559779,8430366,5959171,3211995,200251,7057828,146473,5009357,1663537,5297724,5857284,5965709,841826,6137847,2754471,9004000,9882847,1924550,2275097,4939446,6982176,84551,9132199,8203916,8420801,4741481,3360460,1862331,8956469,5041228,3522643,5347007,9352916,4620287,4723192,7360791,8291502,118807,4861658,8643674,1423252,9063734,4697182,8148944,4284085,6680103,831618,1073794,9435382,7490875,5261640,7316956,2457587,2380607,6754552,973519,5740576,2969295,154094,1293440,2734436,1476448,6179434,1318181,2459910,439121,5426933,1892051,6897827,3290211,}, {0,4372,9114411,3511348,5303549,8504252,8899886,7219886,2404814,5916963,9401407,3176845,2323878,9665260,3264118,5068907,9718553,2428422,9785058,5125319,4964162,353287,4994103,2743116,5072773,2873995,4118261,4147362,1625539,4013038,781923,6058701,1683767,8904926,5285777,9460182,2094593,1242641,8459688,9507224,7364969,9654034,7915687,1190174,894955,666193,6642497,1669016,5764623,8950093,9618605,2027941,4747867,9314659,7750146,8896104,2268483,1171257,3018685,56021,6985787,3348016,1677711,4028910,6889401,1728891,5860107,5962880,4733394,235328,8109039,9783971,8198607,9493099,5506658,1053539,9519380,6356695,7472420,7686942,7424142,6900394,3862314,7284390,2886929,9932447,5016557,7699394,7151582,3122674,1588906,4262270,6137303,2997124,}, {0,4466,9945183,7236444,7153594,1138622,853379,4613313,8170173,5386209,1082158,520058,1911639,2661112,3660795,1103753,6474824,8277460,2499457,6346841,9067876,5377508,1116378,4532720,7252821,1254289,3626905,7633365,5600267,3531794,5687695,9305137,8397763,6084437,7974434,4618592,5556997,2203068,8250702,3845986,5459356,4874523,947818,15716,3297808,4063905,8296735,2571757,4563740,1913867,8188665,338648,4842387,3784580,9203994,1339588,4397800,7764168,6221192,2944093,2871059,7781183,8777630,8398834,5207985,6728506,4123643,3194014,6143871,5759070,918353,2990008,6041740,9680448,5220842,2120118,4757410,1790997,8033817,6004570,6038365,7277792,8864825,9718837,6472243,2415870,8628044,1511259,9534971,4981577,7248906,7878833,9397195,5770693,7317127,}, {0,4561,802775,20281,8597189,7274889,5328576,178508,3825158,8157757,8744108,7106795,3297335,4584409,5741889,2253189,1108336,6218837,8579567,4032099,4415868,8462040,6028778,8457892,6382104,9677194,586567,3263178,4635122,2524201,7153495,8111485,5368989,323565,6327071,5964931,9196436,9448150,5910395,3192489,9782929,3571390,5500961,7243247,9477486,8534420,3878197,3374308,7193297,1666290,8395659,7943723,303678,149866,1603226,3571133,6317539,5850058,6920465,8265453,7518694,6170319,8574355,5519923,9670838,5823495,1954791,5639852,8039300,6744441,901967,3565756,6615127,579047,2508575,158980,1386507,3597990,253131,9992805,8155112,9836700,7735951,6869180,3727185,3551110,410338,1775742,2509787,3544851,2110713,9850588,3424245,1272768,379189,2698437,}, {0,4657,1687703,4723754,2089463,9024806,176258,9151902,766547,2053107,2070640,7936587,9031742,9377337,2434122,9721572,4502118,7777279,886799,9502279,758098,9768871,8597556,8766196,4799817,1923884,9478080,3214996,2764946,9390610,6347460,2671419,1711995,1889419,353734,9823050,2880637,1866726,2436641,3983146,4934945,5166679,3955380,369994,1652501,7221980,2873131,9456001,5776308,7339367,2782569,1569901,2076397,7098128,1938302,1232953,7485232,8432786,7497770,6182347,8399549,7955331,4815194,4993387,3790425,8545500,1475954,2519281,210995,4261640,9862419,5163615,5857322,7545611,4645350,3341724,5772624,3380672,1348739,613898,5621978,3181139,6831052,1375179,8077679,3717956,4814718,8220749,5579095,511450,493456,9675869,7271840,5706894,3137489,1975110,9009639,}, {0,4754,2600570,4618284,764904,2202475,6101930,559335,8406505,1153785,2083644,3342113,4804276,6722823,2102234,1843484,3308700,2365448,1062715,4999862,5863423,5293483,9870099,1608671,3788564,2781865,5655958,631252,5715115,8903257,5323057,3364938,5469558,5671619,8488729,955494,71638,1902629,9775776,8942482,1437499,9462501,4285580,7527796,3649377,2199856,3932608,5513694,4680195,8167427,3043698,9987071,3641623,6836970,2141916,5373287,932220,8770541,8897218,595002,2477784,8230663,4114695,8667260,9428629,8200999,1253427,4600248,4018807,9893463,2789069,2016381,7588856,3776436,2471137,8529838,6968810,1241891,8420633,783080,2051050,1637709,9970009,5034183,4331660,6455992,5669745,8677353,1507130,1141172,8878951,9692098,7214753,2098365,7200997,4618049,925809,4456002,}, {0,4852,3541958,3394296,9970799,3252321,5415046,5334384,6653633,353586,6269265,173381,2584181,8412498,1410078,5188088,9559945,2836204,3220932,1624985,8484717,8642559,9874093,46617,2754535,7472870,1484773,9759558,3031662,53361,3372351,1661192,6920584,9795743,3046454,457668,4525960,4338384,257046,9180707,2869233,787434,7657235,3055540,2055563,2205358,1164772,7587080,9009682,5059499,9645276,628565,4169284,4689934,599944,3282395,9460996,1189253,4171703,9240502,4871596,6945435,8555541,9720969,1308599,4216036,9471401,8307842,3663010,6143269,8726816,804155,9913901,1620850,8375300,6241102,2746380,1278253,4869949,2284277,9237266,2366393,6659024,6791590,2434282,8846625,5243085,4855328,8128969,9595611,9917421,2794017,429191,994036,3533186,5145707,9493911,8383551,7104085,}, {0,4951,4512455,5170003,533641,9887293,2400369,2301134,2800880,6747439,2803189,2997816,4847764,2777765,4184578,37389,2452011,679734,9002849,8644467,6783690,2624391,98871,8022704,6791362,7968465,7558512,4575156,7418895,2468435,4485446,7318636,8339806,4351570,6431711,4229935,332226,169270,9820589,7990270,8574070,1107488,6416967,9555126,4849434,2400231,4328209,1781332,7688540,966669,4667626,8821698,6414001,204422,5827523,4010949,906131,1234458,9212951,3668626,1035509,9783973,2333557,229193,3057720,4968974,680080,445131,6889432,3184414,4067600,6836949,783473,7061388,9378617,5930581,8325909,8874498,7703505,8503596,9136032,3148169,3103906,6230876,7791514,8954304,6321872,319526,3964120,2205955,8450184,7940656,9928560,8541055,3801067,1151825,5719649,8530521,7987112,1892,}, {0,5051,5512655,4500253,4002619,9566397,6103590,681218,9102511,4609532,3409031,942029,5521983,8851834,7039841,603688,3547972,9690240,3466853,9565295,4827016,5238789,4202435,8369665,6502069,4336693,5929708,7638080,4945801,5684498,6420468,6176790,1191431,2186584,5759908,5525124,2128155,7823698,8196704,9079723,9788529,2272041,215987,2783362,5360487,3983451,7129143,633398,7852646,3610962,1468541,3761069,4237541,2052566,7690310,3678179,4176152,7224923,8700743,4379645,4340362,2561024,8956789,5531526,2028640,5074919,2172629,9379839,229879,8052730,7522595,4894598,3511659,3332723,1678155,6582931,4888914,25760,9941766,2924198,9836026,3050460,4119943,1226951,3868190,2611597,6880607,4039311,1294816,5773637,3998189,8758874,4836910,6924775,845590,8434621,9275821,7675306,5066748,1858297,792607,}, }; inline long long read(){ long long x(0);char c = getchar(); while(c < '0' || c > '9'){c = getchar();} while(c >= '0' && c <= '9'){ x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); } return x; } void work(){ n = read(), m = read(); if(n < m) swap(n,m); printf("%lld",ans[n][m]); } signed main(){ // freopen("a.out","w",stdout); freopen("chess.in","r",stdin); freopen("chess.out","w",stdout); work(); return 0; }
T3 奇妙的 Fibonacci
咕咕咕
$$\huge{\mathcal{Here\ We\ Are,\ Nick\ Of\ Time\ !}}$$




浙公网安备 33010602011771号