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240
 852 591 261
 937 701 236
 1849 1444 405
 758 573 185
 2740 2351 389
 789 585 204
 943 737 206
 1021 804 217
 2115 1728 387
 1037 803 234
 3235 2752 483
 1750 1433 317
 1446 1218 228
 3554 2985 569
 4080 3473 607
 989 813 176
 13051 11518 1533
 311 271 40
 827 724 103
 499 453 46
 999 896 103
 507 439 68
 3507 3169 338
 274 238 36
 875 776 99
 431 375 56
 855 760 95
 172 143 29
 3921 3565 356
 12 10 2
 427 389 38
 143 125 18
 1143 1025 118
 127 111 16
 125 109 16
 777 709 68
 440 375 65
 6189 5558 631
 1169 1094 75
 156 143 13
 1087 1001 86
 520 480 40
 634 558 76
 8482 7727 755
 428 395 33
 7520 7173 347
 2368 2230 138
 3495 3313 182
 2987 2596 391
 828991 796000 32991
 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 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
 
];
D = [
32 89 1 4
10 12 0 1
22 15 1 0
17 23 0 1
17 19 0 0
29 23 2 1
365 24 7 7
8576 34 14 19
84129 43 27 33
229335 54 45 33
235948 58 45 40
164956 40 45 49
85154 69 39 52
41405 65 40 36
16749 70 36 25
6255 60 35 34
2026 56 31 28
523 56 33 26
164 55 20 29
64 43 21 18
66 36 25 18
50 35 21 13
53 36 16 11
47 23 20 14
33 25 14 13
31 30 17 8
43 30 13 12
31 26 8 18
18 39 16 16
41 28 16 9
30 27 15 8
30 35 11 11
34 33 16 14
43 34 10 19
41 32 15 12
47 32 13 18
42 34 23 18
40 34 15 19
41 24 18 14
21 28 20 15
30 36 16 22
31 23 24 19
28 24 24 24
23 32 33 28
24 34 26 37
34 26 33 40
42 45 41 43
43 35 30 36
47 43 37 46
61 37 45 46
47 42 72 46
52 46 50 46
52 65 53 54
74 49 68 57
72 75 88 74
86 78 66 80
102 78 98 68
135 115 101 103
82 115 92 96
105 120 97 111
126 134 111 122
129 103 102 120
115 99 138 122
109 102 94 101
85 69 80 75
56 71 47 48
62 60 60 54
63 73 66 76
107 72 80 83
73 67 55 77
59 59 44 62
44 77 59 50
2 4 4 4
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

];x = [
10 12 15 19 23 28 35 43 53 66 81 100 123 152 187 231 285 351 433 534 658 811 1000 1233 1520 1874 2310 2848 3511 4329 5337 6579 8111 10000 12328 15199 18738 23101 28480 35112 43288 53367 65793 81113 100000 123285 151991 187382 231013 284804 351119 432876 533670 657933 811131 1000000 1232847 1519911 1873817 2310130 2848036 3511192 4328761 5336699 6579332 8111308 10000000 12328467 15199111 18738174 23101297 28480359 35111917 43287613 53366992 65793322 81113083 100000000 123284674 151991108 187381742 231012970 284803587 351119173 432876128 533669923 657933225 811130831 1000000000 1232846739 1519911083 1873817423 2310129700 2848035868 3511191734 4328761281 5336699231 6579332247 8111308308 10000000000 
];
