暴力&打表
_LH巨神好像不太会打表,这里来普及一下
还有暴力这么重要的东西网上讲的人竟然不多……
一.打表
打表,就是针对一些输入数据比较小的题目的一种骗分技巧,当然有时候也可以在正解或暴力中起一定优化作用。
例题:
奇怪的道路
小宇从历史书上了解到一个古老的文明。这个文明在各个方面高度发达,交通方面也不例外。考古学家已经知道,这个文明在全盛时期有n座城市,编号为1..n。m条道路连接在这些城市之间,每条道路将两个城市连接起来,使得两地的居民可以方便地来往。一对城市之间可能存在多条道路。 据史料记载,这个文明的交通网络满足两个奇怪的特征。首先,这个文明崇拜数字K,所以对于任何一条道路,设它连接的两个城市分别为u和v,则必定满足1 <=|u - v| <= K。此外,任何一个城市都与恰好偶数条道路相连(0也被认为是偶数)。不过,由于时间过于久远,具体的交通网络我们已经无法得知了。小宇很好奇这n个城市之间究竟有多少种可能的连接方法,于是她向你求助。 方法数可能很大,你只需要输出方法数模1000000007后的结果。输入共一行,为3个整数n,m,K。输出1个整数,表示方案数模1000000007后的结果。100%的数据满足1<= n <= 30, 0 <= m <= 30, 1 <= K <= 8.两种可能的连接方法不同当且仅当存在一对城市,它们间的道路数在两种方法中不同。在交通网络中,有可能存在两个城市无法互相到达。
样例
样例输入
3 4 1
样例输出
3
题解
标准打表题,暴力跑出后打成表就AC了
#include<bits/stdc++.h> using namespace std; int ans[30][31][8]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,2,3,3,3,3,3,3,3,0,1,1,1,1,1,1,1,3,6,6,6,6,6,6,6,0,3,3,3,3,3,3,3,4,10,10,10,10,10,10,10,0,6,6,6,6,6,6,6,5,15,15,15,15,15,15,15,0,10,10,10,10,10,10,10,6,21,21,21,21,21,21,21,0,15,15,15,15,15,15,15,7,28,28,28,28,28,28,28,0,21,21,21,21,21,21,21,8,36,36,36,36,36,36,36,0,28,28,28,28,28,28,28,9,45,45,45,45,45,45,45,0,36,36,36,36,36,36,36,10,55,55,55,55,55,55,55,0,45,45,45,45,45,45,45,11,66,66,66,66,66,66,66,0,55,55,55,55,55,55,55,12,78,78,78,78,78,78,78,0,66,66,66,66,66,66,66,13,91,91,91,91,91,91,91,0,78,78,78,78,78,78,78,14,105,105,105,105,105,105,105,0,91,91,91,91,91,91,91,15,120,120,120,120,120,120,120,0,105,105,105,105,105,105,105,16,136,136,136,136,136,136,136,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,3,5,6,6,6,6,6,6,0,2,4,4,4,4,4,4,6,16,24,24,24,24,24,24,0,10,24,24,24,24,24,24,10,40,74,74,74,74,74,74,0,30,84,84,84,84,84,84,15,85,189,189,189,189,189,189,0,70,224,224,224,224,224,224,21,161,420,420,420,420,420,420,0,140,504,504,504,504,504,504,28,280,840,840,840,840,840,840,0,252,1008,1008,1008,1008,1008,1008,36,456,1548,1548,1548,1548,1548,1548,0,420,1848,1848,1848,1848,1848,1848,45,705,2673,2673,2673,2673,2673,2673,0,660,3168,3168,3168,3168,3168,3168,55,1045,4378,4378,4378,4378,4378,4378,0,990,5148,5148,5148,5148,5148,5148,66,1496,6864,6864,6864,6864,6864,6864,0,1430,8008,8008,8008,8008,8008,8008,78,2080,10374,10374,10374,10374,10374,10374,0,2002,12012,12012,12012,12012,12012,12012,91,2821,15197,15197,15197,15197,15197,15197,0,2730,17472,17472,17472,17472,17472,17472,105,3745,21672,21672,21672,21672,21672,21672,0,3640,24752,24752,24752,24752,24752,24752,120,4880,30192,30192,30192,30192,30192,30192,0,4760,34272,34272,34272,34272,34272,34272,136,6256,41208,41208,41208,41208,41208,41208,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,4,7,9,10,10,10,10,10,0,3,7,10,10,10,10,10,10,30,54,70,70,70,70,70,0,22,69,112,112,112,112,112,20,99,252,385,385,385,385,385,0,91,372,680,680,680,680,680,35,273,954,1690,1690,1690,1690,1690,0,280,1452,2960,2960,2960,2960,2960,56,658,3042,6128,6128,6128,6128,6128,0,714,4590,10340,10340,10340,10340,10340,84,1428,8448,19040,19040,19040,19040,19040,0,1596,12474,30800,30800,30800,30800,30800,120,2850,20988,52250,52250,52250,52250,52250,0,3234,30228,81224,81224,81224,81224,81224,165,5313,47619,129635,129635,129635,129635,129635,0,6072,66924,194480,194480,194480,194480,194480,220,9361,100243,296010,296010,296010,296010,296010,0,10725,137709,430430,430430,430430,430430,430430,286,15730,198198,630630,630630,630630,630630,630630,0,18018,266695,892320,892320,892320,892320,892320,364,25389,371592,1266915,1266915,1266915,1266915,1266915,0,29029,490776,1750320,1750320,1750320,1750320,1750320,455,39585,665652,2420340,2420340,2420340,2420340,2420340,0,45136,864552,3274336,3274336,3274336,3274336,3274336,560,59892,1146276,4426800,4426800,4426800,4426800,4426800,0,68068,1466556,5878600,5878600,5878600,5878600,5878600,680,88264,1906992,7794160,7794160,7794160,7794160,7794160,0,99960,2406996,10180960,10180960,10180960,10180960,10180960,816,127092,3077544,13270132,13270132,13270132,13270132,13270132,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,5,9,12,14,15,15,15,15,0,4,10,16,20,20,20,20,15,48,94,138,165,165,165,165,0,38,138,272,372,372,372,372,35,196,586,1118,1515,1515,1515,1515,0,200,1026,2480,3720,3720,3720,3720,70,666,2988,7280,11055,11055,11055,11055,0,768,5410,15840,25960,25960,25960,25960,126,1962,12714,38434,64449,64449,64449,64449,0,2400,22614,79088,140820,140820,140820,140820,210,5148,46330,169438,310115,310115,310115,310115,0,6468,79638,328272,631380,631380,631380,631380,330,12276,148278,643106,1273485,1273485,1273485,1273485,0,15576,245518,1178576,2435616,2435616,2435616,2435616,495,27027,425841,2156189,4588230,4588230,4588230,4588230,0,34320,680238,3762560,8315040,8315040,8315040,8315040,715,55627,1116674,6517780,14822810,14822810,14822810,14822810,0,70356,1726140,10899040,25648920,25648920,25648920,25648920,1001,108108,2711124,18051484,43676094,43676094,43676094,43676094,0,135850,4069052,29088224,72623320,72623320,72623320,72623320,1365,199992,6162364,46394292,118964130,118964130,118964130,118964130,0,249392,9008844,72383008,191086800,191086800,191086800,191086800,1820,354484,13231712,111786424,302764050,302764050,302764050,302764050,0,438464,18895500,169531072,471833232,471833232,471833232,471833232,2380,605268,27035100,254613148,726236430,726236430,726236430,726236430,0,742560,37807796,376592160,102037233,102037233,102037233,102037233,3060,1000008,52880268,551935940,653588803,653588803,653588803,653588803,0,1217064,72578100,798404320,450678506,450678506,450678506,450678506,3876,1604664,99513716,145142229,595145665,595145665,595145665,595145665,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,6,11,15,18,20,21,21,21,0,5,13,22,30,35,35,35,21,70,143,225,295,336,336,336,0,58,228,501,792,987,987,987,56,338,1101,2388,3815,4781,4781,4781,0,370,2165,6180,11430,15312,15312,15312,126,1356,7059,20879,40220,55041,55041,55041,0,1706,14528,53290,114900,165347,165347,165347,252,4708,37925,148242,337325,498876,498876,498876,0,6336,76611,355670,886440,1365483,1365483,1365483,462,14498,173485,869911,2297780,3643136,3643136,3643136,0,20086,336620,1947141,5557120,9125508,9125508,9125508,792,40326,689919,4332880,13107620,22148076,22148076,22148076,0,56342,1279779,9089040,29443048,51339456,51339456,51339456,1287,102817,2433878,18783750,64396850,115430238,115430238,115430238,0,143286,4322880,37199272,135697680,250357716,250357716,250357716,2002,243243,7751082,72385532,278837220,528220938,528220938,528220938,0,336193,13229774,136324980,556089020,82138099,82138099,82138099,3003,539396,22610442,252249510,83997287,163326578,163326578,163326578,0,737308,37237208,454690406,61215426,218837178,218837178,218837178,4368,1130636,61140670,806007816,840228169,51598226,51598226,51598226,0,1526668,97533726,398167585,5049211,42563991,42563991,42563991,6188,2255968,154770618,388216196,547776296,571807193,571807193,571807193,0,3008252,239981248,5192296,68690286,607579903,607579903,607579903,8568,4310112,369745206,622905730,188855424,753071931,753071931,753071931,0,5677048,558954730,779654718,32222625,712000042,712000042,712000042,11628,7923836,839263174,321684395,145895257,761511453,761511453,761511453,0,10314036,240234721,451601281,597728340,202963342,202963342,202963342,15504,14076340,820238715,1226211,944344922,942535308,942535308,942535308,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,7,13,18,22,25,27,28,28,0,6,16,28,40,50,56,56,28,96,201,329,456,558,616,616,0,82,336,792,1364,1902,2240,2240,84,533,1818,4258,7524,10714,12740,12740,0,612,3860,12304,25892,40794,50872,50872,210,2454,13929,46670,104496,172050,219212,219212,0,3284,31496,134688,345940,616566,814912,814912,462,9779,90428,420392,1166784,2190582,2969148,2969148,0,14118,201828,1141392,3547268,7117050,9948568,9948568,924,34528,500805,3128268,10549028,22319830,32007976,32007976,0,51506,1072768,7893568,29362180,65879814,97109376,97109376,1716,109811,2401848,19631320,79168164,187057458,282663556,282663556,0,165256,4901104,46181376,203413268,507076258,785896216,785896216,3003,318799,10150942,106287018,506168806,325891753,104424980,104424980,0,477776,19744416,234772512,212567101,338637753,426210909,426210909,5005,854542,38433332,506721868,820296440,141146056,535739049,535739049,0,1266772,71509008,58862385,357003258,231669577,700806376,700806376,8008,2135744,132251742,164215140,954729401,163815806,742855812,742855812,0,3121404,236383712,307375924,826999329,688343332,190816247,190816247,12376,5018910,418678452,399823180,270483018,101641637,864814521,864814521,0,7222280,721894056,16130480,37051811,811684327,875432998,875432998,18564,11169340,231927199,978079093,801211389,133062839,621258434,621258434,0,15821832,56868546,31992159,893067228,161902313,295394051,295394051,27132,23684298,398093739,348220915,829480962,557641310,654259119,654259119,0,33037732,512454309,325069888,166266806,39024908,436812826,436812826,38760,48103744,850378278,250491584,13507845,47499721,529429901,529429901,0,66120684,990488485,815619970,932270737,948532983,465781927,465781927,54264,94000106,898450917,660081653,360679429,572942995,802835256,802835256,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,8,15,21,26,30,33,35,36,0,7,19,34,50,65,77,84,36,126,268,449,645,826,966,1044,0,110,462,1137,2075,3102,3997,4536,120,789,2758,6763,12777,19740,26005,29814,0,938,6180,21165,48683,85081,120760,143496,330,4085,24336,88443,219514,407690,602329,729702,0,5728,59135,280961,815482,1672387,2623397,3269332,792,18305,184372,966771,3083608,6786138,11140668,14190660,0,27931,446172,2904693,10556016,25290888,43735615,57094488,1716,72696,1199640,8781243,35237967,90696881,164166268,219050637,0,115186,2793056,24517965,110327313,306512115,581675122,793776672,3432,259843,6765312,67201727,333550927,993471979,970306115,746208614,0,416200,14990728,174517817,961268525,72613829,368328358,64988769,6435,846142,33529194,441780533,675281040,140925170,761267442,704759869,0,1349664,70645500,73798886,162608475,150217920,933638260,331397367,11440,2536570,148189170,542336613,571194048,260019881,540542192,156222548,0,3997074,297769326,825629786,603901248,81315390,296150430,770432657,19448,7065132,592063248,22118282,635127736,333650712,249476579,284071205,0,10954868,139263997,321802203,374773622,139288215,263629066,274456700,31824,18432318,164033926,214401505,399885681,854364293,442520171,144481335,0,28076452,4556308,39805432,983819251,732517945,449255105,579165533,50388,45362766,310757227,373526139,57316173,905279053,146904836,242388059,0,67855840,61794715,927241945,858732488,224138768,390153369,352250455,77520,105962734,28520483,665282420,34558963,625372567,424501322,473876408,0,155713778,865131803,844130459,278116033,570073920,522452527,591223697,116280,236190520,142418764,142098091,314954968,142750992,15660970,397932231,0,341228828,652546482,735311465,369482770,921461437,663455673,948187351,170544,504711402,629181950,419081264,805778272,13303498,485552985,668707460,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,9,17,24,30,35,39,42,44,0,8,22,40,60,80,98,112,45,160,344,585,860,1136,1380,1564,0,142,606,1530,2910,4566,6234,7616,165,1114,3947,9937,19640,32112,45264,56452,0,1360,9194,32922,80808,151960,234930,310320,495,6391,39086,149442,399189,807278,1316974,1801238,0,9294,100362,511716,1625822,3684920,6487290,9301760,1287,31717,336258,1914024,6762003,16672378,31186860,46487188,0,50588,868770,6251676,25536840,69517672,139122854,216311888,3003,139568,2506546,20574923,94027488,278872980,593154180,958690348,0,232360,6259874,62622262,325306156,55788749,390058208,17373988,6435,552840,16260294,186933287,85552897,829983087,196986577,48707916,0,932960,38692674,529116294,454842667,257836685,757835519,129320549,12870,1993590,92733452,457615943,603385521,88278753,789617611,968035563,0,3353352,209674338,855804931,294711299,874844580,283331175,246002348,24310,6607934,470710426,918727903,315404798,159424253,495081331,244465787,0,10976832,13310583,682865384,497000562,289614132,876719921,4672258,43758,20305072,152874812,822272350,26964424,616719552,216349960,567234421,0,33154012,428914066,956993642,209741714,950284264,2359510,671334241,75582,58288580,972914696,182397839,233158815,904148648,660793915,811639516,0,93354752,712408127,508117213,804089733,336949250,440572451,355253195,125970,157388210,422082716,137249423,332176354,754202700,736265991,187482278,0,247119548,457058255,126232931,81032939,305489953,814186228,415423119,203490,402161486,605175336,970365877,733104295,569350896,413671553,523517973,0,619222008,404831975,520988090,321606050,797869802,526026320,997992330,319770,977656400,527055014,126226756,598913720,984382727,904043883,640454544,0,477301217,450914534,698118709,433530389,697725994,949077322,39919333,490314,271788186,754377243,22384568,824113813,424136064,765709590,903661728,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,10,19,27,34,40,45,49,52,0,9,25,46,70,95,119,140,55,198,429,737,1100,1485,1853,2169,0,178,768,1971,3855,6270,8920,11445,220,1516,5412,13826,28148,47956,70946,93691,0,1890,12979,47773,122768,243995,401203,569460,715,9530,59072,232723,654826,1411256,2473279,3676618,0,14271,158363,845709,2872328,7022970,13443809,21235468,2002,51772,565209,3396048,12946004,34784013,71552817,118993399,0,85636,1540412,11890905,53076628,159223485,354549926,623129553,5005,249456,4727875,42106783,212542824,702175425,681296112,111501827,0,432912,12528562,138012838,801027294,927484524,547536094,713718742,11440,1082440,34617890,443953172,912583406,698028493,366120176,340222106,0,1910128,87634525,355234819,107351658,630659749,445509740,251885141,24310,4275874,223413944,24577727,811569730,526005912,398104203,910148369,0,7532284,537709625,479428773,765037676,586349653,617578442,63979896,48620,15514830,283504214,813787025,89620726,709326332,401898242,271754954,0,27000634,939493202,273407613,744251277,992514517,941758667,913740876,92378,52122852,634576325,383909745,107219394,398501546,374918532,112725540,0,89124364,503284634,524532326,184241726,647332590,474074878,615394838,167960,163305760,177797927,343329906,765057711,991599150,476591226,4097685,0,273655404,300077962,321848959,497876216,420735218,160870056,968667150,293930,480287472,462202122,33708034,816688575,512366658,646245236,849403376,0,788095414,849991423,63427471,234019597,747561752,964418608,68025359,497420,333750213,710574059,930414565,327009539,455977319,994559357,977378186,0,143357382,438842363,215034770,124822307,891156958,167311619,170556719,817190,515577579,530978678,741615525,595838742,463489562,918715958,939851775,0,536824925,200332570,558761375,198632732,606962624,835151835,48416371,1307504,836751744,381104699,520093538,63264382,616916692,326315305,552297979,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,11,21,30,38,45,51,56,60,0,10,28,52,80,110,140,168,66,240,523,905,1365,1871,2381,2853,0,218,948,2460,4900,8190,12020,15980,286,2003,7180,18488,38346,67320,103278,142206,0,2540,17616,65940,174758,362606,625144,935420,1001,13676,85282,341555,995420,2252700,4170278,6591275,0,20980,236676,1301460,4636184,12033734,24569420,41682824,3003,80588,893534,5554284,22379089,64324505,142347166,256693376,0,137428,2545128,20606836,98319380,318512184,770031088,482170681,8008,421200,8249077,77735462,423294209,522947881,995013441,177775057,0,757276,22988736,271533644,717574429,897059086,659413055,815280462,19448,1983412,67085764,932604576,732233862,968260765,514984474,958147903,0,3637884,179214868,42162143,206712727,444951444,827928911,529431536,43758,8504914,482760510,657997080,8870724,437663948,753583897,172087439,0,15601252,228008929,463129489,57063196,954286774,975429061,261065501,92378,33493466,97839789,313566661,460818944,618397577,499679610,873676032,0,60746752,500729163,261456034,400515934,864537753,181609091,885999183,184756,122048608,887403858,560432598,864291397,936023423,8342156,349743360,0,217501064,322448357,667617176,350821824,822178282,585170024,287310184,352716,414322966,797938409,762448382,252164531,648678433,910305713,127653395,0,723289556,430300047,62805419,222220619,228825433,914850854,19236911,646646,318474533,594967132,986466529,276073916,756257845,577322163,71435968,0,252145726,283198233,218883461,849099629,880461058,284096036,540114433,1144066,955286519,923145168,643694817,802051552,788921516,797093906,858725730,0,610632818,581963909,12904329,292095797,717828462,911200345,442432322,1961256,242626243,878156742,21586577,235380985,706406186,783088182,281642714,0,396389334,42545821,310516817,925378563,79748043,275723307,733917576,3268760,417834210,960796140,622333565,978158947,889787688,532016986,653190598,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,12,23,33,42,50,57,63,68,0,11,31,58,90,125,161,196,78,286,626,1089,1655,2293,2961,3611,0,262,1146,2997,6045,10305,15498,21173,364,2583,9278,23986,50319,90226,142345,202378,0,3322,23186,87677,237208,508317,910152,1418941,1365,19019,118795,479565,1429861,3356910,6490615,10758701,0,29774,339189,1898486,6993520,19015835,40888438,73337413,4368,120675,1347199,8541803,35797486,108481080,254530125,488851706,0,211206,3981995,33260508,166746977,574259595,483085650,64166831,12376,678975,13547960,132542908,764285384,944073122,309189719,398874000,0,1258622,39418007,488992521,306157987,322552499,247659972,59880191,31824,3443067,120743988,778817497,840975725,954690952,667646712,487770265,0,6532402,338047780,150395955,413072383,492115356,660718116,768585545,75582,15904933,956497107,719953860,102496850,939902821,474002703,216578203,0,30241542,555338404,116237775,156055868,155139636,482439989,833265823,167960,67484209,775128033,264278836,58112989,635042663,666005988,367985992,0,127005264,245601770,340632123,745240592,705281891,238047361,195168248,352716,264880903,235586725,8922158,394420310,887172986,334336016,376326207,0,490010170,22031233,73288075,911364996,690977256,899715563,291063335,705432,967999321,577921920,370101774,477198595,665308528,433207090,762226164,0,754013343,484548936,713615862,770666812,420175905,538419696,537950419,1352078,313124104,371582346,727135789,548053393,522597958,571542402,30016997,0,871735055,760184491,867632599,471691333,15959336,296791751,742220905,2496144,677828015,890692628,553522891,188061293,998796896,819593206,946470823,0,504724164,502731184,963947748,129374124,72605915,830127370,689528332,4457400,564580481,839064452,510389307,260230921,488343274,774070,870248225,0,210499345,873352637,887598571,494155466,856453088,201498143,267480533,7726160,397521067,976726538,781752089,917284139,537538484,26882887,174314305,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,13,25,36,46,55,63,70,76,0,12,34,64,100,140,182,224,91,336,738,1289,1970,2751,3591,4439,0,310,1362,3582,7290,12600,19320,26974,455,3264,11733,30384,64174,116725,188153,274365,0,4248,29770,113262,310636,681168,1257758,2027102,1820,25765,160772,650750,1967675,4743149,9498532,16360802,0,41038,470136,2658124,10018436,28209126,63302494,118786008,6188,174967,1956065,12528330,53940391,170208461,419068878,847037514,0,313180,5966896,50808790,264043352,953990088,602169420,693934013,18564,1053174,21208820,212388387,277771580,196314120,580054463,763247747,0,2005190,64048344,821327930,843198997,906411720,845552206,219620756,50388,5714618,204882270,142297351,919252992,132614605,93719702,113649838,0,11171528,597674688,434528011,92324562,694710768,61524541,194298945,125970,28257061,767149382,607680797,830443306,424959662,722363103,681254134,0,55478286,931130472,765417690,172742406,467552993,944990353,762953937,293930,128367667,673292391,146862445,666038950,63222669,134730417,722997845,0,249774996,404298234,259065027,668311225,611162873,544129119,968334454,646646,539460100,505795057,320570428,181277567,198971323,647187714,543912796,0,32414643,814431120,642934702,741466496,300829363,978048042,110493189,1352078,110156606,395543863,85025620,826025976,553147605,539788566,322548829,0,956195859,572446441,764081497,665971663,685624576,862827756,774224672,2704156,726295606,528733830,884245054,981566652,696420514,756895143,687563995,0,165490592,822313075,830124162,506608615,440547030,912921761,433939890,5200300,618156983,188014485,416563901,822742189,339696128,363405631,737113339,0,702705371,99527593,457819168,301485278,920111829,24355940,250586129,9657700,694849508,79651214,391477382,282927109,921621103,609499722,94080349,0,917741593,329363160,755646441,553679106,327046186,874374990,453346254,17383860,98699614,488098358,210169431,604777293,259834297,111580147,913368212,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,14,27,39,50,60,69,77,84,0,13,37,70,110,155,203,252,105,390,859,1505,2310,3245,4270,5334,0,362,1596,4215,8635,15075,23457,33334,560,4054,14572,37746,80030,146958,240695,358176,0,5330,37449,142983,395651,881954,1668126,2763668,2380,34136,212455,859455,2619442,6432321,13241141,23543044,0,55189,634080,3603743,13787836,39843982,92549278,180355795,8568,246854,2754117,17704560,77576479,252365952,646211479,363056783,0,450608,8633773,74328260,396130760,485620645,239042215,731903933,27132,1581351,31937148,324042641,9768745,530942072,892862170,916627936,0,3082829,99637219,305149205,645380848,649577926,817888375,445641787,77520,9132459,331441262,219953853,20036348,118839204,595487384,985017510,0,18336567,2573411,867422687,487538786,35344404,975342201,383449618,203490,48076557,83967981,940213013,616729793,519115454,792670778,515291570,0,97156090,946077406,13456941,968872099,358206269,85495349,975566784,497420,232589467,829494219,694288804,314424604,907575402,799209336,519711596,0,466464505,608011255,849195032,638797401,11022539,853955823,620039547,1144066,41055061,766166834,499169688,401228149,167868703,376619174,82384782,0,55112982,771379209,651670330,154587717,479697016,637726030,811948556,2496144,336799336,777747378,948984858,557256291,727905283,464746428,592699819,0,389579936,600864222,618478439,790706648,149212322,416127509,525002494,5200300,905729158,903162485,383872704,909144748,446396519,458296475,603060409,0,982174996,538523148,964684699,39487239,233710649,330976227,589183277,10400600,977265589,798138726,865828208,239387780,330240609,743079444,775766060,0,584146296,588425754,171040461,707686977,527403636,549549430,343234263,20058300,660591769,647733750,458095641,541069613,715387009,971232132,59779665,0,922642116,916525735,783312258,688195333,874998065,45898837,755123082,37442160,364094688,88686006,920073573,198262719,153095104,342303112,537270235,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,15,29,42,54,65,75,84,92,0,14,40,76,120,170,224,280,120,448,989,1737,2675,3775,4998,6294,0,418,1848,4896,10080,17730,27888,40208,680,4961,17822,46136,98011,181101,300020,453748,0,6580,46304,177128,492936,1111680,2140752,3629680,3060,44370,275167,1110325,3396881,8446966,17753064,32414330,0,72676,835908,4760552,18384780,54144188,129197680,260009072,11628,340214,3779676,24284168,107531939,357753506,945015648,67069034,0,631876,12135784,105033040,569306344,197032798,501659622,552352695,38760,2309229,46574094,475343384,10364341,212788010,396017727,992816590,0,4597724,149542136,983551833,68308263,791287503,941517156,624830265,116280,14129554,515503404,250990740,560844291,420296435,420306934,250500771,0,29060448,610472605,670507168,807423240,399942067,281290198,769167152,319770,78827497,134702085,765310814,679597107,320984632,532213,769417565,0,163526608,421639851,84924098,713516311,212588667,878079207,691103103,817190,404257205,186767646,250757448,752767648,133887864,863249290,476108468,0,833449862,804943496,476915658,282344341,891224432,493552234,619818096,1961256,918417691,936194525,930628704,61196245,234104968,253857776,677488036,0,896484181,215369029,30253577,141914640,865982487,945557613,179871755,4457400,473287057,811643589,812727017,410865988,520999124,520266985,263379263,0,872684188,494422422,682079573,95936329,679651487,484334089,141893949,9657700,16066227,921466646,482547592,929670655,353702757,616980861,303705273,0,197279152,766247165,560252875,928710323,394214065,389654561,949705795,20058300,45396100,252303568,961487409,753055280,838338799,248827348,570297663,0,925619842,435437457,431895440,569950154,192222366,493340749,435708382,40116600,143868792,140397165,411452948,796424307,876894984,455109768,85856307,0,384678736,898657336,112319713,275532963,469781819,206228960,494208149,77558760,435741456,56728288,266202304,107412447,196211680,770262558,411204967,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,16,31,45,58,70,81,91,100,0,15,43,82,130,185,245,308,136,510,1128,1985,3065,4341,5775,7318,0,478,2118,5625,11625,20565,32613,47558,816,5993,21510,55618,118242,219352,366345,561026,0,8010,56416,215985,603221,1371554,2676959,4624282,3876,56721,350312,1408271,4312757,10812143,23076973,43051628,0,93980,1080831,6155480,23900010,71340306,173822932,359295543,15504,459445,5075627,32504467,144712756,489216169,324272188,986130933,0,866578,16646461,144287702,790411371,116390159,497140842,521686282,54264,3291772,66111292,675339069,334629892,518166172,289264437,393563222,0,6679316,217797795,907078341,509583738,767684498,179268506,832900590,170544,21257046,775829773,523398873,334726309,140009931,986726176,45974907,0,44682784,494955159,352530200,337556605,50404814,732115447,595502385,490314,125179367,219348520,806636364,798960897,222175135,858992813,175087576,0,265964528,471594776,357159169,544575854,95000200,935742726,672025589,1307504,677798513,872438842,176944014,38654135,557126604,321089222,773270658,0,433288036,412814302,533057478,24372216,26854548,918856464,371092994,3268760,396733705,464643968,404972343,921602747,623893931,455181403,408631039,0,82793045,616518232,936094910,894558343,938221416,913184408,670108120,7726160,844775660,495958772,998367256,322140407,121010025,995232537,281747341,0,408749606,964348633,271091577,290465870,122471127,436556160,535148112,17383860,151323612,24950039,909022487,2089108,184010799,623354210,620699049,0,372802702,417118264,77136437,302822456,203213034,892031295,548176249,37442160,688127430,460913609,288909015,206032156,137773064,686225091,72090870,0,755357314,470570632,521403202,909797003,785379346,883774181,532840886,77558760,697854186,203801117,212425315,187557902,151066555,52281607,212230151,0,453353259,934573456,952821459,713327897,900738661,717402894,806759804,155117520,8793329,940583238,83248801,441868435,105358625,245372949,510829175,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,17,33,48,62,75,87,98,108,0,16,46,88,140,200,266,336,153,576,1276,2249,3480,4943,6601,8406,0,542,2406,6402,13270,23580,37632,55356,969,7158,25663,66256,140848,261921,439938,680046,0,9632,67866,259842,727256,1662956,3278478,5745780,4845,71459,439375,1758461,5380760,13555702,29259169,55509450,0,119614,1374384,7817064,30431936,91679296,226985124,479371314,20349,609497,6689661,42626942,190119424,649747826,792483763,143387209,0,1165596,22360888,193614966,66979425,272790492,330201553,980198731,74613,4594321,91706452,934417238,43839893,736736836,795704246,554274529,0,9483414,309196586,134676956,415500560,197186804,344901770,133382887,245157,31206219,135445256,381377638,547031551,766048853,360190936,654393740,0,66912256,748347857,755977521,661934815,610953829,643111505,170589326,735471,193310532,725986142,761829581,321106973,303751840,22089095,779720203,0,419828690,574552382,164062461,526587008,207600883,988430462,127900751,2042975,101281535,535936871,773961773,928101931,626979578,363344686,528331300,0,383918158,750357498,797960380,84975377,24420701,648472978,1270174,5311735,807928080,302681544,26041195,397631476,144143552,657472400,782463663,0,409203184,67962403,480526170,53682150,784122616,16109379,666286193,13037895,514312943,481683766,108872105,861140555,20781321,332545203,936555153,0,796395227,367420391,783041721,732413445,286629286,459877210,230951576,30421755,980256470,106905270,563471601,724685042,747732388,248851419,576121687,0,800029108,364283520,493509271,284588369,203933360,375017772,147558852,67863915,509336409,207670832,512422564,448001586,919186475,734769360,601856731,0,294067150,410641843,846836860,915965341,955876314,400992258,641618509,145422675,568214300,46122055,998677480,68682870,876764652,287052298,744098360,0,842363276,731415953,528547088,221060500,73452945,807709357,686648094,300540195,781146502,538925248,240754179,424046611,814160017,262346226,574720902,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,18,35,51,66,80,93,105,116,0,17,49,94,150,215,287,364,171,646,1433,2529,3920,5581,7476,9558,0,610,2712,7227,15015,26775,42945,63602,1140,8464,30308,78114,165954,309023,521102,811124,0,11458,80735,308987,865791,1987393,3947426,6996218,5985,88870,543922,2166319,6615335,16708156,36351167,69866564,0,150123,1722426,9775392,38085418,115429917,289259182,621491261,26334,795904,8674518,54937884,244849501,842575993,358170955,561734473,0,1541180,29496910,254701589,407312365,697037455,104634805,263974770,100947,6293794,124699719,264419711,206502898,176229407,157265100,7139875,0,13195499,429373501,734618151,288763266,894269648,907423385,209281185,346104,44832940,622275211,233208596,869991150,131696914,18798998,263894812,0,97896774,484914274,109377507,12281099,495861075,972473531,423801689,1081575,291263713,148826522,651367615,786053703,55152093,972045449,32797221,0,645486385,658423461,925152390,580514697,892129711,995635735,46792098,3124550,740509022,753516043,173414944,593024097,56574325,602061810,104920589,0,850226290,792420574,196886122,79375526,53434958,695008505,750371879,8436285,630016837,423249839,81220917,536081490,999948027,131111368,237651229,0,47314348,583053391,992598434,436522833,803360802,872113019,42207736,21474180,608664009,123147825,78293859,359952302,513319710,11202036,226431754,0,485551826,48832290,607157797,636271757,787180966,178689659,470121186,51895935,120836495,810181817,887367258,34846052,607964936,1757574,433562117,0,483192506,118200009,269207610,55218967,676017483,438608997,446447226,119759850,326445427,229483464,405675282,300709632,204872632,619126377,361816554,0,375226953,436166138,398993431,769554304,312015696,190836648,975986999,265182525,23049424,212757233,52640347,316167859,562721114,286147587,922692121,0,70974998,562804603,656702395,762634709,619363934,200414916,736091820,565722720,518523562,892868830,160952137,320360637,416666646,539769046,905646218,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,19,37,54,70,85,99,112,124,0,18,52,100,160,230,308,392,190,720,1599,2825,4385,6255,8400,10774,0,682,3036,8100,16860,30150,48552,72296,1330,9919,35472,91256,193685,360874,610162,954646,0,13500,95104,363708,1019576,2346450,4686256,8378340,7315,109256,665600,2637525,8031596,20302359,44410314,86208886,0,186084,2131140,12062088,46971200,142884246,361257204,786881756,33649,1024816,11088230,69749164,310097690,71219776,30167867,263186053,0,2007028,38296348,329404440,820531157,422353859,925639995,697502731,134596,8479950,166630823,678752366,899220951,168657539,643816664,276214616,0,18034220,584895536,785382723,696521689,906531877,922666297,940470713,480700,63184709,269838056,559360028,509329353,579759399,296751764,487779919,0,140301862,844368947,83917943,742777918,479622631,763340017,994806603,1562275,429358885,108668241,212978332,413425971,888124273,933790330,418486066,0,969519806,197902822,615035335,950773390,391411469,458116543,796551682,4686825,684008701,508050809,507779007,551495724,942659362,311920248,65518666,0,58391710,295816565,454998292,686128953,31665865,987173963,312199135,13123110,537463719,163074549,57305252,33245322,516557404,415576635,832777106,0,685585402,622048499,661539753,919425916,480426808,428316532,326604553,34597290,756255999,787593128,742819818,501853814,883451866,867926578,582990901,0,753672575,954238116,278851412,410481583,689042671,514038125,729820998,86493225,494400278,248792042,311636396,376263946,809442159,662179216,840998736,0,792209939,178394285,48731090,568597661,476814848,915632886,330632969,206253075,155117067,427546165,395747905,116253361,533731743,580117043,913412254,0,389504464,359679119,439139486,959050397,201791151,163392787,208467530,471435600,32977667,144480270,665595890,144988617,725480336,841111967,86822004,0,369693906,402435608,265819692,424789635,891824166,964806413,629045141,37158313,476840992,996550972,748538124,806354169,215786767,127390988,950255220,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,20,39,57,74,90,105,119,132,0,19,55,106,170,245,329,420,210,798,1774,3137,4875,6965,9373,12054,0,758,3378,9021,18805,33705,54453,81438,1540,11531,41182,105746,224166,417690,707455,1111049,0,15770,111054,424293,1189361,2741747,5497689,9895548,8855,132935,806137,3178015,9645292,24373191,53499707,104632049,0,228106,2607033,14710312,57205462,174356388,443642563,976799235,42504,1303031,13994364,87399165,387155651,339522875,817871059,269612577,0,2578366,49026214,419757256,316601922,484927188,902473525,598622708,177100,11256717,219256979,192498374,207373617,76786809,572175118,874782783,0,24255082,783355586,376552475,277717729,566230129,90093182,739370534,657800,87530445,117996608,920884698,275547822,314888906,832496549,597149904,0,197397715,995732531,853667336,892951870,760089888,948999698,413993850,2220075,620669259,375954265,337709216,441455194,908493630,837921668,868299080,0,426134665,326188285,569542914,612147535,918354248,573446272,254701585,6906900,49054520,752808701,552182202,416990171,25974446,570776381,596511056,0,313478637,347404433,747123198,814122479,32046875,950022650,675248775,20030010,464786888,692101349,681424016,566877608,303075508,61947373,714217245,0,710061511,434511010,70089801,415618417,265744537,992589332,252465957,54627300,666537973,463194380,310019893,228641725,769134308,845915085,306831244,0,294098724,241584596,461568264,102553046,460235910,109167707,538915639,141120525,974987408,236388518,597765735,210835778,179318461,679563894,470567047,0,721435438,206227055,737045272,57348176,189802100,52325673,394015322,347373600,606196840,807119856,581309076,449365905,456553955,529272879,840557640,0,923637540,178704060,886999607,8762912,365798682,636109124,472523820,818809200,660094455,179544501,834920643,313637837,609451575,884043249,606189329,0,735705648,232208736,371875164,821290492,458617102,154803284,160679309,855967513,489758015,594408555,704166297,581665466,508591602,65078168,127688171,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,21,41,60,78,95,111,126,140,0,20,58,112,180,260,350,448,231,880,1958,3465,5390,7711,10395,13398,0,838,3738,9990,20850,37440,60648,91028,1771,13308,47465,121648,257522,479687,813323,1280805,0,18280,128666,491030,1375896,3174904,6384638,11551828,10626,160241,967342,3793981,11472798,28957133,63687673,125242571,0,276830,3156936,17754760,68909544,210178098,537136180,192575149,53130,1638027,17462265,108253791,477412558,651644052,731422567,603447536,0,3272028,61979926,527977868,906351918,924073123,150974457,285280383,230230,14743584,284571517,822537875,225681806,298308720,330617204,340410379,0,32154326,33470765,609728107,749577299,535608446,912692402,339374116,888030,119393136,213770097,968235427,655203403,812994282,123404923,193295109,0,273155376,141545003,159507318,801339252,6000550,93659262,965941538,3108105,881566268,896638687,546658420,177781403,181293655,733168773,822427608,0,58792050,962235284,625950066,915316848,405226787,43959456,936355662,10015005,988865385,68946664,961575131,253697360,807060597,457269451,753914219,0,20784894,390768483,14828166,761999315,157992467,720272043,630922023,30045015,685975117,948942791,999164604,65107220,133928506,402644751,542619405,0,433985431,2195928,665386739,130849003,51974371,827384522,123031373,84672315,885644028,911784963,193948035,182617540,764669429,745859004,131164083,0,327925960,208579034,292630462,364697732,999686405,219564637,112492283,225792840,726686191,750028055,908342283,722179636,119556104,537169008,687610952,0,943992359,293133371,544779432,142668422,910378350,629260447,26283743,573166440,475437820,835205191,670282248,547743066,169752601,147184007,54429764,0,960479088,956793094,265047974,370206819,418636429,568860147,388006056,391975633,998494175,550212801,389782121,695196990,792434527,318203862,546943227,0,210374203,409449508,529340985,208716504,554710151,112082039,109929077,247943139,567893011,527763534,456517392,611227931,236088750,994787151,754973667,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,22,43,63,82,100,117,133,148,0,21,61,118,190,275,371,476,253,966,2151,3809,5930,8493,11466,14806,0,922,4116,11007,22995,41355,67137,101066,2024,15258,54348,139026,293878,547081,928109,1464408,0,21042,148021,564207,1579931,3647541,7350134,13351654,12650,191524,1151105,4491871,13531114,34092092,75047068,148157945,0,332929,3788004,21231664,82209821,250697096,642516287,435646645,65780,2037994,21567299,132707490,582356523,12051895,781823605,288295833,0,4106536,77478523,656475744,601485611,782370006,795645648,82995223,296010,19077057,364823241,587673418,58712634,269348411,404743331,297540873,0,42073001,345185142,599489362,913470160,851344998,925755292,10621949,1184040,160585481,612209051,450601270,880310226,284540466,92405953,221958180,0,372352481,522451961,377326860,743281865,351444308,823341564,704830024,4292145,232339726,821071440,510206502,579626713,672609256,425063115,183782781,0,922085523,954892907,606775521,983758963,99428587,916139994,834552036,14307150,701140925,427233850,230859002,489535074,101831465,440412790,805979945,0,711509561,792919777,438965889,885393919,822365729,877267666,807122173,44352165,912613017,418280108,537485370,360307191,298647217,791174098,834416804,0,386147983,588417765,378916570,851576555,71766291,190090056,886368806,129024480,769563939,959161145,761914487,181737370,457602820,42407908,833764079,0,373072263,220741271,265111265,347461131,242011532,389929360,709615391,354817320,712877666,702223516,487931545,693131140,712818999,808066889,624774748,0,154403555,235879411,853481051,598387275,795048953,451329049,36660160,927983760,385936788,33450154,513750354,823602490,413617421,66713834,883472606,0,889183391,942082737,639859069,79495438,263212399,636470689,401024716,319959386,404646856,39231279,701235274,397989370,272924800,242708823,690271596,0,690268779,192125915,908367769,573515005,281833156,941950611,120628336,567902525,852596187,850939747,726008466,729186995,841869649,172073276,115783660,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,23,45,66,86,105,123,140,156,0,22,64,124,200,290,392,504,276,1056,2353,4169,6495,9311,12586,16278,0,1010,4512,12072,25240,45450,73920,111552,2300,17389,61858,157944,333359,620088,1052156,1662364,0,24068,169200,644112,1802216,4161278,8397264,15299880,14950,227150,1359397,5278389,15837865,39817315,87654647,173505969,0,397108,4507716,25178792,97237668,296275758,760613840,707573353,80730,2511866,26391096,161184278,703576746,425519466,980990294,349407689,0,5102180,95871880,807859648,414605166,105714080,971136291,332100343,376740,24412179,462536517,508760798,821377521,467073668,401493578,536389493,0,54401228,729776781,474399158,660472588,962817134,957358681,129970505,1560780,213248652,377335077,225838973,996284125,138216412,436117763,539861494,0,500689020,422179007,590997225,580391055,910268146,923721579,24274931,5852925,697899634,536111473,613488890,217869492,92216828,507136271,375571472,0,83886568,245312070,167772014,61477672,46234774,612131627,954451267,20160075,438107302,65171008,555509585,855948603,442528386,78422333,31744678,0,73353738,17517578,621009719,785791196,523744527,394962942,857729361,64512240,413982899,165463955,542219681,307683775,996221,287216208,90294044,0,669225934,141822350,413584622,501699607,314928532,791825183,455249532,193536720,723130345,9012862,221748341,914322282,37937027,222537575,168001756,0,829734330,590615552,668014933,955097228,555812232,102564673,391848634,548354040,967861687,784100292,207614961,920321550,968945821,223157028,134833362,0,552837761,362941534,713003608,32076331,291307560,502913717,784020683,476337793,658574987,556698636,517036716,569642290,994268351,46669984,232107804,0,770937372,974612997,368643915,481758862,352328543,545903809,866990287,796297179,588281068,418163039,183349485,601891382,976611604,443214401,35101421,0,305334444,261207636,500811104,462539073,638334749,646656674,369772625,364199697,795640446,925006449,399817430,721791684,273982397,668917203,600651964,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,24,47,69,90,110,129,147,164,0,23,67,130,210,305,413,532,300,1150,2564,4545,7085,10165,13755,17814,0,1102,4926,13185,27585,49725,80997,122486,2600,19709,70022,178466,376090,698924,1185807,1875184,0,27370,192284,731033,2043501,4717735,9529115,17401630,17550,267501,1594270,6160495,18411301,46173355,101590182,201423629,0,470104,5323875,29635448,114129460,347290229,892300675,10041992,98280,3069353,32021793,194138763,842766285,897121364,341688569,814003645,0,6281098,117539923,984945320,359235984,943339975,822300718,394026050,475020,30924114,580532090,608844514,639466550,411697266,60546276,97252911,0,69582656,199969218,378049377,976989588,764173863,309349042,1443657,2035800,279894304,583147739,271034753,930661513,421289305,772308770,644179964,0,664913562,172909452,670521212,425015459,499109910,239901619,264219191,7888725,308566209,700684935,572195916,577654006,443216636,490314829,35367713,0,627782613,49058811,38266738,249600947,252352421,286125655,562321305,28048800,518259536,491363439,823802377,553228659,98829147,223078574,145979940,0,986723736,476102158,267569677,313658941,810351607,163521603,855447729,92561040,162807491,584814739,237281883,775205421,487410556,379130550,758961488,0,400871700,61058294,520337736,108543202,631651297,425148463,762932127,286097760,761081740,509152322,400927593,681707273,203618002,123372076,263868700,0,570318422,572262688,262780826,325414456,713667637,507302287,927201606,834451800,345249744,796973785,25113195,559709776,231910573,800341031,298466159,0,750021009,769464655,465056581,712355058,564854968,373676882,340335728,310789586,174724693,441728707,771390682,310026229,236079570,792943528,729292370,0,462855584,526678372,983188156,213128738,128517328,371670392,8390367,107086758,508128895,163033767,790411157,873081992,567179468,55144108,387346345,0,768278458,335548086,134684226,969757524,99013683,797104421,409893437,471286455,396950021,96025595,491544482,133145122,155520111,577422703,909448753,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,25,49,72,94,115,135,154,172,0,24,70,136,220,320,434,560,325,1248,2784,4937,7700,11055,14973,19414,0,1198,5358,14346,30030,54180,88368,133868,2925,22226,78867,200656,422196,783805,1329405,2103380,0,30960,217354,825258,2304536,5318532,10748774,19662196,20475,312975,1857857,7145405,21270297,53202062,116936151,232055843,0,552686,6244608,34642472,133026572,404129914,38485559,344861334,118755,3720973,38554277,232057169,1725082,432233971,877511189,711458840,0,7667356,142893844,190763149,449855038,347838638,504461695,656168846,593775,38809795,721948630,913297530,650220771,668160324,265320015,351033725,0,88119110,770047312,470146053,950575359,621666834,939379491,811734924,2629575,363449961,314700642,693707043,564073548,229213589,1695728,730934150,0,872960392,161080419,355617853,326491250,363166881,489380038,122115801,10518300,100955255,285011703,102342858,697500359,135555332,760530623,324888407,0,655832517,59416019,684678112,353128105,962327851,962748115,589380384,38567100,340001494,629710062,9059890,967827181,821744835,425246430,625253829,0,567262640,133973897,450722284,81257141,419699864,325595566,163842231,131128140,10724011,361213688,673596542,638696176,423289500,410320630,972483125,0,251963788,102412384,625190995,174295092,75482735,505030287,320856470,417225900,456319099,888209486,250138260,356149635,546319042,449700108,16278402,0,754526594,845199037,412949652,350774132,524171585,94522907,887746220,251677693,600667154,998142544,330207909,418873733,899525239,788400888,831847979,0,870959962,573860616,808422057,226534428,24380897,618776382,591193331,562467279,900107958,967375949,56850060,89883012,626367501,138146360,436815526,0,484998436,461257694,304955918,688625509,867994877,759308774,207388923,669554037,629942916,647539156,76645652,12958678,196021313,824272189,746287185,0,647188031,507452364,852081014,81031461,180544558,582821466,378482907,140840485,679081591,87489404,154690233,619689415,387042695,776816620,181512379,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,26,51,75,98,120,141,161,180,0,25,73,142,230,335,455,588,351,1350,3013,5345,8340,11981,16240,21078,0,1298,5808,15555,32575,58815,96033,145698,3276,24948,88420,224578,471802,874947,1483293,2347464,0,34850,244491,927075,2586071,5965289,12059328,22086954,23751,363986,2152372,8240591,24434353,60946582,133777563,265554369,0,645655,7278366,40242240,154075379,467197248,200111117,713951010,142506,4478084,46090428,275458360,182363101,36538402,602855595,73375832,0,9287028,172377316,428565881,701920947,375190696,183474929,535201148,736281,48289636,890265007,449965139,2936664,847724603,50825006,69634268,0,110575431,455977400,927632432,776030148,398217571,612168265,613342141,3365856,467307906,669249014,743657827,804533627,88846082,559378930,9492639,0,134098001,833612715,344915588,988156203,812611757,867353266,135619442,13884156,118965901,613730439,647239608,188904454,46847206,648361425,619502757,0,291665955,673410037,427569489,916889364,117683416,722689210,787687236,52451256,397399386,116710024,252206198,847637872,170593797,520248678,29416868,0,215496119,952690660,747489944,867263122,626778042,698740800,610181351,183579396,898037272,189955704,606623624,433763553,310252958,360006345,41390617,0,98204674,505631482,231122051,282590854,986769797,823853744,293341707,600805296,350304088,423396406,974513821,63233397,450287075,883091404,665543270,0,126867774,111992100,741563914,619023833,540281885,482049068,413077815,852482989,830792287,40140931,158743405,792429514,938031356,311693105,679505366,0,217017098,657178261,951413205,60838056,758062889,131169646,303617148,414950261,5355018,321139918,708855334,281546449,33145758,237771699,164186183,0,107407231,788354392,495923955,907768544,69218107,494242469,855213241,84504291,755010157,520826589,895355019,381368253,882771032,988102371,740463997,0,181933838,515718597,157342128,608723848,373732597,871345623,231490331,225344776,522807502,942662881,867435205,630689870,451381325,870404265,550036092,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,27,53,78,102,125,147,168,188,0,26,76,148,240,350,476,616,378,1456,3251,5769,9005,12943,17556,22806,0,1402,6276,16812,35220,63630,103992,157976,3654,27883,98708,250296,525033,972566,1647814,2607948,0,39052,273776,1036772,2888856,6659626,13463864,24681280,27405,420964,2480110,9453781,27923594,69451357,152201872,302076181,0,749844,8433924,46478664,177427256,536907626,378151553,119314651,169911,5352916,54739362,324894864,386703410,716025502,532907987,933356833,0,11168276,206467708,701836257,131904879,84819895,35700999,476065860,906192,59609308,89323288,249312952,859596944,609632005,609349254,446929151,0,137584508,275531924,945849129,761777174,477020922,22189028,856586729,4272048,595377703,757470861,825483242,665641796,326415315,476580655,45642974,0,459089419,704589753,390896947,522238393,769456102,866215134,44263557,18156204,414878274,413158959,164639583,693690993,648687355,95238871,98755977,0,683953703,242151464,41525988,762819878,445438755,372993124,349416096,70607460,298279950,765954614,935637567,680665419,684232940,107066872,155493631,0,674439515,256690868,733439924,834501495,96945771,618198315,38479948,254186856,102788141,847752125,631151910,533438641,490137229,116774823,319943258,0,803169285,725110715,24380968,17473822,593807279,707823485,115996344,854992152,911414444,604282371,68047518,964585946,373328012,511381882,85340842,0,94753830,782775571,575028580,409538882,652063104,630086173,799735852,707475134,478783550,601260210,380975727,977969238,898764870,757981750,452430501,0,519163533,62460071,150363876,44338217,486729740,126662326,841812888,122425388,198647573,948347810,788403526,208005264,124996771,59314266,986489365,0,241243300,493557780,471166450,903606767,407069571,555148078,934467339,206929679,226053349,182558048,379660526,207908483,831219233,315807797,919263516,0,455231968,280706716,970000419,842424769,526112466,654339735,563421289,432274455,756136806,855931993,160017213,75282697,5178888,141138170,300465455,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,28,55,81,106,130,153,175,196,0,27,79,154,250,365,497,644,406,1566,3498,6209,9695,13941,18921,24598,0,1510,6762,18117,37965,68625,112245,170702,4060,31039,109758,277874,582014,1076878,1823311,2885344,0,43578,305290,1154637,3213641,7403163,14965469,27450550,31465,484355,2843447,10792959,31758770,78762125,172298943,341782965,0,866118,9720381,53397192,203238578,613689403,573611223,563031985,201376,6358603,64617674,380953897,616885334,477002566,683635277,326937560,0,13341430,245677300,14294714,757321773,539667700,247964421,952360862,1107568,73041579,323352498,344578941,395522924,662973233,294917880,127388518,0,169852502,248418355,739731198,336494035,786072749,893991416,988809241,5379616,752142479,704763987,511756505,348953321,439333647,235423106,232844182,0,860364734,362400889,400743391,247195290,336149359,303692073,734438109,23535820,50568770,862933532,976960469,834125112,458818037,413655774,564245664,0,10277066,347132553,866679515,452034300,394448599,543989301,443072091,94143280,784920478,214658696,56077324,491916393,501151693,7460658,26797947,0,96077621,117283272,438687462,539412398,940478084,11897671,9082369,348330136,534695473,258275461,412875519,344809052,533809863,272614909,484795937,0,152967088,485515143,412960933,202672085,668739009,152602715,815194507,203322281,139045154,833099600,272797774,66406184,720261540,257547753,380728680,0,930852234,238996939,653744023,232291313,917235465,99956610,48465866,910797415,330055412,357055013,577514586,282571055,820980090,263960011,15763319,0,590719574,861765243,642174758,790824211,417366388,24820725,489333926,33222796,34982868,696528728,250909081,661771360,100601496,893272521,342126926,0,569157894,156055384,818979044,184067864,616725165,369125051,196972691,240152475,895905848,64528585,340532747,287345717,498325380,106237621,915505754,0,352551481,100765849,371083601,692437582,800838819,85065498,833637374,672426930,474962618,66067751,506450068,146410829,848521961,301467906,981191227,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,29,57,84,110,135,159,182,204,0,28,82,160,260,380,518,672,435,1680,3754,6665,10410,14975,20335,26454,0,1622,7266,19470,40810,73800,120792,183876,4495,34424,121597,307376,642870,1188099,2010127,3180164,0,48440,339114,1280958,3561176,8197520,16567230,30400140,35960,554621,3244840,12266365,35961256,88925920,194161043,384840808,0,995374,11147160,61044808,231670720,697983894,787523803,47252436,237336,7509215,75849681,444258387,875167573,326100802,71784664,291524911,0,15839068,290554498,369907086,596761540,806277922,17550276,466297428,1344904,88888218,596993040,771929606,800045419,768717185,627291033,225935811,0,208164262,396412526,545042045,55971604,823821553,67943828,942511744,6724520,942719094,652620989,556898297,330537368,478549381,443863967,539735808,0,352206378,477364399,543238700,530043160,446518094,118014733,523115656,30260340,98850933,652277016,687520562,699915333,60255797,521932769,397723703,0,481425779,104175988,460853369,113482160,975753847,142004378,706767058,124403620,757594100,767891803,212361843,123164471,300733034,911339168,813527344,0,117694771,853156476,492087676,812158545,952575900,129480393,391024011,472733756,80084616,248783034,357802079,437569768,793625806,941035414,846414572,0,964889689,233304343,840627368,927016078,709917342,206623582,855548252,676056037,924392372,758556584,429461916,401873011,30174409,818276362,925920867,0,493830902,930173836,63283080,380981345,797070332,275915045,779180592,586853445,164658914,149343171,160865609,635628977,39727486,693325525,787535425,0,76612472,170218958,803874415,232669876,944792822,216807522,397737658,620076241,646515533,499611139,989633245,159076189,517411608,911032206,864759288,0,197952609,342740002,33199783,189777211,411872674,627690142,367901744,860228716,968080215,89505587,869864117,14597641,793299398,363246663,986982171,0,276114524,375756712,736606180,655057692,864313306,985826255,191786946,532655639,36571349,488218396,457088350,244633725,177956313,145979048,201860393}; int main() { int n,m,k; scanf("%d%d%d",&n,&m,&k); cout<<ans[n-1][m][k-1]<<endl; return 0; }
当然打表的形式多种多样,例题中的表只是最常见的一种。
列举一些常用的表:
1.素数表
2.阶乘表
3.逆元表
当然打表并不一定要直接初始化,也可以通过线性筛/递推打出,所谓预处理其实就是优雅的打表。
打表也不一定要全打出,如果小的点暴力足够拿分就不必费事费力,只打出极限数据就好,这叫做信仰打表。
(一般来说毒瘤出题人都卡着数据极限范围出数据)
打表程序如下:
#include<bits/stdc++.h> using namespace std; int work(int x){ return 1; } int main(){ freopen("1.out","w",stdout); int x=1001; printf("#include<cstdio>\nusing namespace std;\nint a[%d]={0",x);//想打多少就设它加1,如想打1000个x就为1001 for(register int i=1;i<x;++i) printf(",%d",work(i));//work就是暴力,work(i)就是由题目条件得出的结果 printf("};\nint main(){\n \n return 0;\n}"); return 0; } //把1.out粘贴出来自己加个输入输出就行了 //linux可以多开几个终端打不同部分的表,最后合并
二.暴力
暴力形式就多种多样了,列举常见的几种。
1.暴搜
最常见的暴力形式,灵活多变,绝大部分题目都有暴搜的解法。
2.dp
一些题目正解很难想到,但一些复杂度极高的dp($\Theta(2^N)$,$\Theta(N^4)$)等却能很快想到。
这时我们不妨先打出这样的dp再想正解。
3.状压
个别题的送分形式。一般来说数据范围小于20可考虑。
4.打表
已经详细讲解,不再赘述。
5.贪心
可能是错解,不过不妨一试。
6.Hash
字符串常用暴力手段,简单粗暴。
7.分块&莫队
优雅的暴力形式(莫队奇偶性排序加O2碾爆正解)
8.Simpson积分
虽说是暴力,然而我其实并不会用…………
9.随机化
有的时候可以碾爆正解哦~
还有许多其他手段。
注意考试除非一下就想到正解,否则必打暴力。
就算打出正解,暴力也可以成为对拍利器。
不过暴力虽好,但不能满足于暴力,仍然要积极想正解,只会暴力永远平庸,正解才会让你脱颖而出。
end