-rw-r--r-- 8258 high-ctidh-20210523/costpoly.py
tree1 = (0, 0, 3, 8, 12, 19, 25, 34, 39, 48, 56, 67, 74, 85, 95, 111, 117, 131, 141, 154, 163, 176, 188, 206, 214, 230, 242, 257, 268, 286, 303, 332, 339, 364, 379, 400, 411, 429, 443, 463, 473, 491, 505, 522, 535, 555, 574, 605, 614, 641, 658, 681, 694, 714, 730, 752, 764, 787, 806, 828, 846, 877, 907, 961, 969)
multiprod2 = (0, 0, 6, 17, 27, 44, 58, 80, 93, 118, 139, 165, 182, 213, 238, 275, 291, 337, 365, 400, 425, 459, 489, 530, 550, 602, 636, 676, 704, 750, 790, 854, 873, 964, 1013, 1074, 1105, 1161, 1199, 1250, 1279, 1333, 1371, 1415, 1449, 1498, 1543, 1611, 1634, 1731, 1786, 1853, 1890, 1951, 1994, 2049, 2080, 2147, 2196, 2251, 2294, 2367, 2434, 2549, 2571)
multiprod2_selfreciprocal = (0, 0, 3, 11, 12, 29, 31, 49, 39, 74, 88, 105, 92, 136, 143, 168, 126, 200, 223, 261, 266, 304, 312, 332, 280, 374, 398, 449, 424, 505, 489, 536, 402, 575, 604, 684, 674, 757, 777, 824, 802, 879, 902, 949, 930, 1001, 982, 1017, 860, 1070, 1108, 1212, 1180, 1311, 1312, 1385, 1268, 1465, 1460, 1578, 1440, 1657, 1549, 1666, 1266)
multieval_precompute = {
2:{1:0,3:8,5:18,7:22,9:33,11:37,13:44,15:48,17:60,19:65,21:70,23:76,25:82,27:84,29:90,31:92,33:107,35:110,37:118,39:121,41:129,43:132,45:141,47:144,49:152,51:154,53:158,55:160,57:168,59:170,61:174,63:176,},
4:{1:0,3:11,5:23,7:30,9:47,11:52,13:62,15:67,17:84,19:89,21:97,23:103,25:117,27:120,29:127,31:132,33:152,35:163,37:169,39:183,41:185,43:192,45:195,47:202,49:214,51:217,53:223,55:226,57:235,59:237,61:244,63:246,},
6:{1:0,3:27,5:27,7:36,9:53,11:60,13:74,15:82,17:102,19:107,21:117,23:124,25:139,27:146,29:155,31:163,33:183,35:189,37:211,39:217,41:224,43:227,45:234,47:240,49:257,51:266,53:276,55:285,57:293,59:300,61:305,63:312,},
8:{1:0,3:40,5:40,7:40,9:60,11:69,13:85,15:95,17:124,19:129,21:141,23:150,25:171,27:176,29:183,31:195,33:223,35:231,37:245,39:252,41:274,43:276,45:288,47:294,49:324,51:333,53:340,55:342,57:348,59:350,61:361,63:369,},
10:{1:0,3:64,5:64,7:64,9:64,11:75,13:91,15:101,17:130,19:137,21:153,23:162,25:183,27:191,29:204,31:217,33:247,35:252,37:262,39:271,41:292,43:299,45:309,47:322,49:344,51:352,53:366,55:376,57:393,59:396,61:413,63:423,},
12:{1:0,3:81,5:81,7:81,9:81,11:81,13:101,15:113,17:142,19:149,21:165,23:176,25:205,27:213,29:228,31:243,33:277,35:282,37:292,39:301,41:322,43:329,45:341,47:354,49:384,51:391,53:403,55:413,57:429,59:441,61:461,63:471,},
14:{1:0,3:105,5:105,7:105,9:105,11:105,13:105,15:113,17:148,19:158,21:174,23:185,25:216,27:226,29:243,31:259,33:301,35:306,37:319,39:328,41:349,43:358,45:374,47:389,49:425,51:430,53:437,55:448,57:462,59:473,61:489,63:509,},
16:{1:0,3:124,5:124,7:124,9:124,11:124,13:124,15:124,17:159,19:170,21:190,23:203,25:236,27:247,29:266,31:287,33:339,35:344,37:358,39:367,41:392,43:401,45:419,47:436,49:478,51:483,53:491,55:500,57:512,59:524,61:544,63:567,},
18:{1:0,3:163,5:163,7:163,9:163,11:163,13:163,15:163,17:163,19:176,21:196,23:209,25:242,27:253,29:272,31:293,33:345,35:352,37:370,39:379,41:404,43:413,45:431,47:448,49:490,51:498,53:512,55:524,57:542,59:555,61:577,63:601,},
20:{1:0,3:184,5:184,7:184,9:184,11:184,13:184,15:184,17:184,19:184,21:208,23:221,25:254,27:265,29:284,31:305,33:357,35:364,37:382,39:395,41:428,43:437,45:455,47:472,49:514,51:522,53:536,55:551,57:575,59:588,61:610,63:635,},
22:{1:0,3:214,5:214,7:214,9:214,11:214,13:214,15:214,17:214,19:214,21:214,23:227,25:264,27:277,29:296,31:317,33:369,35:376,37:394,39:407,41:440,43:451,45:473,47:490,49:536,51:544,53:560,55:575,57:599,59:614,61:640,63:667,},
24:{1:0,3:239,5:239,7:239,9:239,11:239,13:239,15:239,17:239,19:239,21:239,23:239,25:280,27:295,29:318,31:341,33:393,35:400,37:418,39:431,41:464,43:475,45:497,47:518,49:576,51:584,53:602,55:617,57:645,59:660,61:688,63:717,},
26:{1:0,3:284,5:284,7:284,9:284,11:284,13:284,15:284,17:284,19:284,21:284,23:284,25:284,27:295,29:318,31:341,33:399,35:409,37:427,39:440,41:473,43:484,45:506,47:527,49:587,51:597,53:617,55:633,57:663,59:679,61:709,63:739,},
28:{1:0,3:305,5:305,7:305,9:305,11:305,13:305,15:305,17:305,19:305,21:305,23:305,25:305,27:305,29:320,31:341,33:405,35:418,37:442,39:458,41:491,43:502,45:524,47:545,49:607,51:618,53:640,55:660,57:692,59:708,61:736,63:767,},
30:{1:0,3:331,5:331,7:331,9:331,11:331,13:331,15:331,17:331,19:331,21:331,23:331,25:331,27:331,29:331,31:350,33:416,35:430,37:454,39:470,41:507,43:520,45:542,47:563,49:627,51:639,53:661,55:681,57:715,59:736,61:772,63:804,},
32:{1:0,3:372,5:372,7:372,9:372,11:372,13:372,15:372,17:372,19:372,21:372,23:372,25:372,27:372,29:372,31:372,33:436,35:451,37:477,39:494,41:535,43:550,45:576,47:599,49:665,51:678,53:702,55:723,57:759,59:781,61:819,63:859,},
}
multieval_postcompute = {
2:{1:0,3:9,5:15,7:23,9:33,11:41,13:53,15:69,17:87,19:95,21:107,23:123,25:143,27:159,29:183,31:215,33:249,35:257,37:269,39:285,41:305,43:321,45:345,47:377,49:413,51:429,53:453,55:485,57:525,59:557,61:605,63:669,},
4:{1:0,3:27,5:29,7:37,9:47,11:55,13:67,15:83,17:101,19:109,21:121,23:137,25:157,27:173,29:197,31:229,33:263,35:271,37:283,39:299,41:319,43:335,45:359,47:391,49:427,51:443,53:467,55:499,57:539,59:571,61:619,63:683,},
6:{1:0,3:51,5:51,7:55,9:65,11:73,13:85,15:101,17:119,19:127,21:139,23:155,25:175,27:191,29:215,31:247,33:281,35:289,37:301,39:317,41:337,43:353,45:377,47:409,49:445,51:461,53:485,55:517,57:557,59:589,61:637,63:701,},
8:{1:0,3:89,5:89,7:89,9:91,11:99,13:111,15:127,17:145,19:153,21:165,23:181,25:201,27:217,29:241,31:273,33:307,35:315,37:327,39:343,41:363,43:379,45:403,47:435,49:471,51:487,53:511,55:543,57:583,59:615,61:663,63:727,},
10:{1:0,3:131,5:131,7:131,9:131,11:135,13:147,15:163,17:181,19:189,21:201,23:217,25:237,27:253,29:277,31:309,33:343,35:351,37:363,39:379,41:399,43:415,45:439,47:471,49:507,51:523,53:547,55:579,57:619,59:651,61:699,63:763,},
12:{1:0,3:177,5:177,7:177,9:177,11:177,13:181,15:197,17:215,19:223,21:235,23:251,25:271,27:287,29:311,31:343,33:377,35:385,37:397,39:413,41:433,43:449,45:473,47:505,49:541,51:557,53:581,55:613,57:653,59:685,61:733,63:797,},
14:{1:0,3:205,5:205,7:205,9:205,11:205,13:205,15:213,17:231,19:239,21:251,23:267,25:287,27:303,29:327,31:359,33:393,35:401,37:413,39:429,41:449,43:465,45:489,47:521,49:557,51:573,53:597,55:629,57:669,59:701,61:749,63:813,},
16:{1:0,3:275,5:275,7:275,9:275,11:275,13:275,15:275,17:277,19:285,21:297,23:313,25:333,27:349,29:373,31:405,33:439,35:447,37:459,39:475,41:495,43:511,45:535,47:567,49:603,51:619,53:643,55:675,57:715,59:747,61:795,63:859,},
18:{1:0,3:351,5:351,7:351,9:351,11:351,13:351,15:351,17:351,19:355,21:367,23:383,25:403,27:419,29:443,31:475,33:509,35:517,37:529,39:545,41:565,43:581,45:605,47:637,49:673,51:689,53:713,55:745,57:785,59:817,61:865,63:929,},
20:{1:0,3:423,5:423,7:423,9:423,11:423,13:423,15:423,17:423,19:423,21:427,23:443,25:463,27:479,29:503,31:535,33:569,35:577,37:589,39:605,41:625,43:641,45:665,47:697,49:733,51:749,53:773,55:805,57:845,59:877,61:925,63:989,},
22:{1:0,3:477,5:477,7:477,9:477,11:477,13:477,15:477,17:477,19:477,21:477,23:485,25:505,27:521,29:545,31:577,33:611,35:619,37:631,39:647,41:667,43:683,45:707,47:739,49:775,51:791,53:815,55:847,57:887,59:919,61:967,63:1031,},
24:{1:0,3:567,5:567,7:567,9:567,11:567,13:567,15:567,17:567,19:567,21:567,23:567,25:571,27:587,29:611,31:643,33:677,35:685,37:697,39:713,41:733,43:749,45:773,47:805,49:841,51:857,53:881,55:913,57:953,59:985,61:1033,63:1097,},
26:{1:0,3:723,5:723,7:723,9:723,11:723,13:723,15:723,17:723,19:723,21:723,23:723,25:723,27:731,29:755,31:787,33:821,35:829,37:841,39:857,41:877,43:893,45:917,47:949,49:985,51:1001,53:1025,55:1057,57:1097,59:1129,61:1177,63:1241,},
28:{1:0,3:753,5:753,7:753,9:753,11:753,13:753,15:753,17:753,19:753,21:753,23:753,25:753,27:753,29:761,31:793,33:827,35:835,37:847,39:863,41:883,43:899,45:923,47:955,49:991,51:1007,53:1031,55:1063,57:1103,59:1135,61:1183,63:1247,},
30:{1:0,3:695,5:695,7:695,9:695,11:695,13:695,15:695,17:695,19:695,21:695,23:695,25:695,27:695,29:695,31:711,33:745,35:753,37:765,39:781,41:801,43:817,45:841,47:873,49:909,51:925,53:949,55:981,57:1021,59:1053,61:1101,63:1165,},
32:{1:0,3:825,5:825,7:825,9:825,11:825,13:825,15:825,17:825,19:825,21:825,23:825,25:825,27:825,29:825,31:825,33:827,35:835,37:847,39:863,41:883,43:899,45:923,47:955,49:991,51:1007,53:1031,55:1063,57:1103,59:1135,61:1183,63:1247,},
}