比赛 20121109 评测结果 AAAAAAAAAAAAAAA
题目名称 喜欢摇头的数学牛 最终得分 100
用户昵称 苏轼 运行时间 0.021 s
代码语言 C++ 内存使用 3.20 MiB
提交时间 2012-11-09 16:28:50
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int n,m,num,number=0;
long long w[6000]={0,1223,2741,4409,6133,7919,9733,11657,13499,15401,17389,19423,21383,23321,25391,27449,29443,31601,33613,35759,37813,39971,42073,44201,46447,48611,50753,52919,55103,57191,59359,61631,63809,66103,68371,70657,72823,75079,77351,79621,81799,84127,86371,88801,90977,93179,95441,97813,100109,102317,104729,107033,109391,111781,114113,116447,118819,121123,123439,125743,128189,130447,132851,135277,137477,139901,142169,144731,147107,149419,151703,154111,156593,159017,161387,163841,166351,168863,171169,173647,176081,178487,180749,183283,185641,187963,190409,192847,195281,197753,200183,202693,205211,207563,209929,212369,214811,217409,219829,222289,224737,227233,229601,232003,234629,237203,239731,242119,244597,247031,249439,251947,254537,257053,259537,262139,264643,267131,269413,271927,274529,276929,279571,281947,284527,287117,289717,292183,294809,297403,300023,302579,304901,307337,309989,312583,315047,317539,319901,322403,324949,327443,329957,332461,335033,337541,340183,342691,345271,347801,350377,352819,355307,357977,360637,363269,365689,368197,371099,373661,376127,378779,381373,383963,386429,389171,391679,393997,396637,399239,401987,404539,407357,409867,412303,414977,417631,420163,422803,425281,427991,430589,432983,435427,438143,440723,443231,445771,448667,451039,453889,456523,459113,461933,464549,467213,469691,472139,474769,477317,479909,482507,485209,487897,490459,493127,495589,498257,500807,503593,506131,508817,511417,514061,516701,519227,521789,524413,526943,529681,532333,535019,537661,540373,542999,545747,548453,550993,553643,556441,559081,561703,564367,567053,569771,572311,574949,577529,580201,582809,585493,587891,590659,593353,595967,598687,601309,603919,606653,609241,611953,614617,617107,619819,622529,625187,628051,630893,633469,636059,638977,641749,644447,647057,649643,652429,655003,657793,660403,663127,665659,668543,671201,673787,676523,679277,681787,684559,687179,689867,692543,695263,697897,700759,703393,706019,708563,711187,713927,716693,719639,722173,724751,727471,730199,732923,735479,738313,741007,743833,746773,749429,752117,754781,757661,760267,762959,765521,768199,770867,773603,776429,779021,781741,784451,787207,789883,792553,795217,797869,800573,803441,806011,808937,811561,814279,817049,819773,822407,825029,827719,830497,833023,835951,838769,841459,844201,847037,849743,852557,855359,857963,860779,863491,866029,868771,871513,874351,876913,879679,882377,885187,887839,890717,893341,896009,898787,901687,904633,907211,909683,912451,915479,918149,920921,923591,926161,929051,931873,934547,937379,940189,942847,945647,948449,951161,954043,956953,959759,962441,965113,967961,970721,973289,976039,978947,981887,984701,987433,990323,993107,995909,998561,1001323,1003931,1006721,1009303,1012159,1014869,1017613,1020379,1023067,1025803,1028581,1031447,1034221,1036951,1039943,1042609,1045309,1048129,1051019,1053967,1056667,1059503,1062511,1065133,1068019,1070579,1073537,1076143,1079093,1081711,1084493,1087409,1090373,1092929,1095491,1098341,1101253,1103923,1106569,1109287,1111991,1114723,1117579,1120501,1123379,1126201,1128811,1131617,1134283,1137029,1139959,1142837,1145689,1148621,1151243,1154129,1156807,1159523,1162297,1164841,1167667,1170461,1173301,1176089,1178803,1181407,1184129,1187003,1189649,1192409,1195171,1198073,1200949,1203817,1206749,1209779,1212473,1215133,1217893,1220773,1223603,1226417,1229269,1231987,1235149,1238033,1240769,1243709,1246397,1249063,1251947,1254767,1257517,1260277,1263107,1265863,1268567,1271293,1274041,1277039,1279853,1282639,1285517,1288163,1291019,1293961,1296817,1299709,1302397,1305307,1308221,1310927,1313839,1316717,1319429,1322257,1324957,1327901,1330831,1333613,1336481,1339259,1342051,1344799,1347757,1350731,1353487,1356227,1359173,1361959,1364761,1367617,1370459,1373357,1376171,1378801,1381487,1384631,1387271,1390241,1393123,1395859,1398367,1401139,1404071,1407061,1409879,1412641,1415773,1418741,1421611,1424471,1427039,1429907,1432699,1435363,1438159,1441049,1443941,1446719,1449599,1452433,1455089,1457999,1460951,1463597,1466329,1469393,1472293,1475213,1477979,1480673,1483451,1486411,1489231,1491967,1494659,1497541,1500529,1503319,1505899,1508789,1511539,1514363,1517279,1520203,1523219,1525921,1528897,1531897,1534901,1537661,1540499,1543417,1546297,1549061,1551961,1554881,1557547,1560271,1563421,1566163,1569173,1571953,1574747,1577599,1580581,1583539,1586513,1589333,1592341,1595173,1598011,1601023,1603541,1606403,1609261,1612133,1615151,1618051,1620881,1623767,1626479,1629209,1632143,1634819,1637693,1640833,1643779,1646527,1649587,1652459,1655131,1657927,1660943,1663777,1666733,1669313,1672381,1675087,1677997,1680659,1683673,1686547,1689553,1692407,1695341,1698077,1700807,1703693,1706633,1709479,1712353,1715393,1718281,1721143,1724221,1726943,1729813,1732831,1735771,1738669,1741409,1744397,1747153,1749887,1752659,1755563,1758439,1761763,1764619,1767539,1770437,1773371,1776113,1778929,1781743,1784633,1787459,1790557,1793303,1796107,1798967,1801853,1804871,1807571,1810357,1813351,1816117,1819283,1822181,1824857,1827659,1830443,1833319,1836287,1839457,1842349,1845119,1847903,1851019,1853713,1856297,1859281,1862213,1865057,1867753,1870667,1873549,1876451,1879379,1882147,1885201,1888063,1890793,1893589,1896547,1899481,1902497,1905517,1908317,1911103,1913983,1916773,1919761,1922749,1925611,1928257,1931159,1934117,1937051,1939879,1942747,1945597,1948327,1951483,1954313,1957129,1960199,1963001,1966007,1969049,1972177,1975201,1978117,1980907,1983743,1986757,1989671,1992509,1995391,1998077,2000963,2003879,2006707,2009489,2012447,2015177,2018113,2021003,2023843,2026889,2029717,2032643,2035349,2038403,2041421,2044127,2047121,2050229,2053201,2056207,2058871,2061887,2064581,2067581,2070451,2073349,2076419,2079323,2082463,2085287,2088133,2091149,2093869,2096993,2099893,2102717,2105591,2108461,2111363,2114351,2117131,2120171,2123129,2126101,2128871,2131813,2134841,2137627,2140573,2143469,2146231,2149151,2152219,2155079,2157787,2160553,2163481,2166601,2169539,2172473,2175451,2178191,2181173,2184223,2187121,2190031,2192899,2195863,2198881,2201989,2204827,2207633,2210389,2213423,2216587,2219641,2222621,2225563,2228299,2231297,2234129,2236951,2240023,2242993,2245861,2248723,2251903,2254799,2257559,2260387,2263381,2266177,2269009,2271749,2274497,2277553,2280517,2283727,2286763,2289649,2292469,2295509,2298391,2301199,2304139,2307229,2309969,2313061,2316073,2319091,2322143,2325181,2327933,2331061,2333927,2336861,2339921,2342741,2345743,2348809,2351821,2354773,2357743,2360543,2363441,2366297,2369209,2372327,2375299,2378273,2381147,2383991,2386939,2389747,2392619,2395867,2398499,2401537,2404471,2407417,2410621,2413517,2416327,2419229,2422111,2425229,2428057,2431139,2434139,2437037,2440219,2443061,2445847,2448863,2451797,2454587,2457617,2460487,2463449,2466323,2469413,2472313,2475367,2478347,2481247,2484331,2487139,2490029,2493167,2496083,2499023,2501987,2504767,2507773,2510743,2513591,2516567,2519641,2522699,2525249,2528411,2531027,2534143,2537083,2540173,2543221,2546101,2549101,2552119,2554969,2558009,2560937,2563811,2566829,2569789,2572649,2575549,2578273,2581177,2583979,2587007,2589893,2593067,2595893,2598847,2601857,2604887,2608049,2610989,2613931,2616703,2619809,2622757,2625641,2628817,2631529,2634403,2637469,2640551,2643427,2646089,2649173,2652029,2655047,2657761,2660753,2663887,2666663,2669767,2673089,2675909,2678983,2681857,2684809,2687723,2690557,2693501,2696429,2699369,2702257,2705243,2708249,2711087,2714029,2716999,2719631,2722957,2725997,2729093,2731979,2735129,2738269,2741147,2743991,2747071,2750159,2752987,2756129,2759111,2761903,2764873,2767729,2770883,2773697,2776817,2779771,2782789,2785633,2788661,2791807,2794723,2797849,2800583,2803561,2806361,2809309,2812063,2814841,2817817,2820751,2823589,2826667,2829793,2832701,2835367,2838169,2841353,2844199,2847293,2850179,2853187,2856121,2859289,2862313,2865329,2868043,2871257,2874169,2877313,2880461,2883371,2886319,2889319,2892289,2895323,2898527,2901317,2904311,2907271,2910137,2913259,2916307,2919157,2922133,2925079,2928151,2931079,2934263,2937059,2939941,2943257,2946221,2949229,2952127,2955181,2958383,2961331,2964229,2967119,2970031,2973059,2976097,2979173,2981947,2984873,2987843,2991047,2993909,2996909,2999813,3002743,3005609,3008659,3011627,3014581,3017689,3020779,3023843,3026839,3029861,3032831,3035869,3038933,3041947,3044827,3047767,3050959,3053909,3057007,3060107,3062989,3066251,3069169,3071969,3074791,3077687,3080743,3083713,3086711,3089477,3092371,3095497,3098509,3101831,3104627,3107633,3110519,3113573,3116537,3119219,3122321,3125351,3128393,3131251,3134267,3137447,3140369,3143447,3146567,3149561,3152341,3155267,3158143,3161339,3164443,3167141,3170311,3172997,3176149,3179237,3182341,3185177,3188161,3191059,3193991,3196933,3199883,3202519,3205759,3208607,3211441,3214531,3217381,3220447,3223459,3226423,3229327,3232429,3235361,3238127,3241201,3244291,3247291,3250333,3253321,3256423,3259471,3262313,3265369,3268219,3271277,3274333,3277123,3280297,3283289,3286331,3289277,3292049,3295337,3298247,3301591,3304669,3307529,3310429,3313417,3316427,3319531,3322441,3325381,3328459,3331423,3334663,3337721,3340669,3343433,3346601,3349579,3352763,3355757,3359101,3362159,3365237,3367951,3370849,3374029,3376991,3379829,3382993,3385931,3388817,3391831,3394927,3397781,3400949,3403711,3406801,3409699,3412537,3415627,3418693,3421751,3424727,3427673,3430813,3433583,3436571,3439477,3442423,3445283,3448517,3451229,3454541,3457453,3460663,3463807,3466829,3469859,3472979,3476063,3479321,3482333,3485617,3488707,3491707,3494641,3497861,3500891,3503893,3506939,3509983,3512869,3515833,3519157,3522131,3525311,3528403,3531467,3534467,3537491,3540619,3543791,3546737,3549757,3552917,3555943,3558913,3561907,3564871,3567803,3570737,3573877,3576961,3580153,3583123,3586171,3588941,3592243,3595133,3598039,3601001,3604121,3606983,3609773,3612683,3615649,3618497,3621617,3624431,3627383,3630371,3633347,3636511,3639661,3642643,3645767,3648923,3652357,3655411,3658159,3661421,3664351,3667333,3670393,3673199,3676201,3678931,3682103,3685169,3688219,3691153,3694217,3697009,3700013,3703027,3706069,3709073,3712297,3715343,3718277,3721163,3724223,3726977,3729883,3732791,3735887,3738937,3742099,3745283,3748387,3751219,3754087,3757087,3760243,3763699,3766739,3769763,3773053,3775909,3778939,3782011,3784943,3787937,3791167,3794207,3797371,3800201,3803329,3806119,3809489,3812261,3815209,3818033,3821099,3823901,3827209,3830003,3833087,3836291,3839317,3842177,3845273,3848261,3851359,3854297,3857429,3860347,3863477,3866719,3869653,3872899,3875827,3878993,3881959,3885103,3887911,3890969,3893861,3896743,3899867,3903131,3906319,3909107,3911939,3915169,3918311,3921217,3924247,3927251,3930139,3933119,3936301,3939361,3942373,3945157,3948251,3951161,3954443,3957433,3960613,3963809,3967043,3969971,3973027,3976001,3978811,3981883,3985243,3988381,3991609,3994553,3997859,4000861,4003819,4006927,4009897,4012847,4015877,4018979,4022069,4024981,4027913,4030979,4034021,4036909,4039793,4042729,4045721,4048619,4051717,4054879,4057967,4061021,4064107,4067207,4070243,4073233,4076201,4079071,4082251,4085447,4088237,4091357,4094287,4097281,4100443,4103629,4106521,4109459,4112497,4115779,4119053,4121933,4125151,4128199,4131367,4134629,4137773,4140827,4143731,4147007,4149889,4152901,4155839,4158907,4161757,4164637,4167661,4170877,4174021,4177153,4180097,4183057,4185989,4189027,4191991,4195057,4198247,4201217,4204279,4207079,4210253,4213199,4216439,4219573,4222513,4225457,4228613,4231769,4234721,4238033,4241099,4244027,4247371,4250189,4253147,4256233,4259323,4262311,4265267,4268599,4271581,4274597,4277887,4280929,4284037,4287253,4290359,4293389,4296613,4299683,4302631,4305611,4308691,4311809,4314857,4317823,4320793,4324157,4327093,4330127,4333097,4336471,4339333,4342339,4345529,4348691,4351747,4354759,4357993,4361209,4364111,4367243,4370407,4373153,4376231,4379467,4382309,4385287,4388477,4391657,4394783,4397933,4400993,4404019,4407163,4410317,4413239,4416257,4419263,4422139,4425107,4428043,4431001,4434119,4437259,4440041,4442939,4445953,4449127,4452017,4455043,4458133,4461161,4464331,4467271,4470287,4473463,4476509,4479487,4482637,4485479,4488343,4491469,4494577,4497653,4500731,4503797,4506703,4509983,4513247,4516231,4519423,4522457,4525751,4528721,4531811,4534961,4538197,4541153,4544339,4547239,4550473,4553503,4556389,4559647,4562693,4565563,4568519,4571783,4574891,4577927,4580903,4583903,4587043,4590227,4593089,4596143,4599271,4602443,4605509,4608493,4611353,4614521,4617713,4620589,4623793,4626733,4629959,4633157,4636123,4639267,4642373,4645547,4648387,4651463,4654697,4657999,4661093,4664113,4667371,4670207,4673327,4676179,4679321,4682203,4685257,4688069,4691363,4694603,4697317,4700473,4703453,4706591,4709753,4712947,4716053,4718951,4721933,4725197,4728127,4731271,4734073,4737143,4740349,4743307,4746551,4749671,4752901,4755967,4759081,4762099,4765171,4768219,4771321,4774687,4777723,4780771,4783729,4786961,4789991,4793237,4796381,4799393,4802461,4805303,4808369,4811647,4814717,4817737,4820807,4823821,4827241,4830277,4833271,4836133,4838963,4842251,4845499,4848533,4851559,4854623,4857829,4860803,4863941,4866893,4869863,4872871,4876211,4879397,4882217,4885339,4888337,4891099,4894117,4897171,4900099,4902971,4906301,4909193,4912459,4915571,4918807,4921759,4924771,4927873,4930963,4934123,4937197,4940291,4943377,4946231,4949489,4952501,4955563,4958567,4961707,4964741,4967579,4970827,4973989,4976899,4979717,4983127,4986013,4988983,4991843,4995073,4998467,5001301,5004539,5007593,5010727,5014019,5016961,5020079,5023307,5026207,5029253,5032367,5035463,5038793,5041691,5044877,5048047,5051269,5054249,5057113,5060221,5063431,5066539,5069663,5072729,5075867,5078873,5081983,5084999,5087923,5091173,5094151,5097259,5100587,5103607,5106961,5109961,5113051,5116141,5119327,5122301,5125319,5128421,5131541,5134429,5137651,5140589,5143729,5146763,5150059,5153089,5156279,5159351,5162387,5165597,5168743,5171681,5174803,5178049,5181269,5184391,5187517,5190611,5193751,5196769,5199829,5202877,5205817,5208887,5212111,5215127,5218211,5221199,5224451,5227441,5230457,5233681,5236879,5239777,5242921,5245943,5248877,5251819,5254859,5258179,5261251,5264213,5267401,5270521,5273419,5276563,5279689,5282909,5286331,5289299,5292257,5295263,5298347,5301481,5304487,5307469,5310791,5314007,5316973,5320169,5323291,5326301,5329547,5332519,5335559,5338649,5341741,5344739,5347789,5351239,5354221,5357239,5360359,5363461,5366671,5369753,5373061,5375941,5378921,5381989,5384843,5387923,5391209,5394401,5397629,5400673,5403833,5407043,5410121,5413183,5416211,5419517,5422453,5425517,5428613,5431691,5434841,5437907,5440889,5444321,5447317,5450267,5453401,5456533,5459563,5462497,5465503,5468809,5472031,5475137,5478337,5481397,5484487,5487701,5490883,5494003,5497039,5499979,5503133,5506141,5509277,5512579,5515669,5518847,5522131,5525189,5528513,5531693,5534677,5537509,5540497,5543977,5547251,5550287,5553421,5556659,5559811,5562863,5566073,5568961,5571833,5575067,5578369,5581397,5584441,5587531,5590877,5593829,5596937,5599973,5603161,5606509,5609431,5612441,5615699,5618827,5622107,5625157,5628257,5631287,5634403,5637439,5640709,5644031,5647219,5650303,5653433,5656549,5659751,5662831,5665967,5669243,5672311,5675381,5678483,5681737,5684863,5687887,5690941,5693921,5696959,5699927,5703001,5706079,5709307,5712451,5715449,5718367,5721481,5724613,5727649,5730839,5734021,5737393,5740387,5743411,5746603,5749691,5752739,5755817,5759059,5762143,5765401,5768663,5771771,5774833,5778077,5781311,5784439,5787703,5790739,5793779,5797061,5800079,5803321,5806217,5809283,5812363,5815519,5818819,5821817,5825059,5828299,5831387,5834441,5837773,5840761,5843821,5846957,5849939,5852881,5856091,5859437,5862617,5865817,5869001,5872019,5875187,5878123,5881319,5884133,5887061,5890303,5893357,5896277,5899549,5902613,5905667,5908739,5911811,5914789,5917781,5920801,5923901,5926951,5930081,5933173,5936191,5939371,5942429,5945671,5948681,5951987,5955031,5958299,5961349,5964503,5967667,5970803,5974093,5977409,5980321,5983597,5986613,5989673,5992783,5996083,5999303,6002371,6005381,6008357,6011351,6014563,6017647,6020867,6023791,6026723,6029813,6033101,6036713,6039841,6042793,6045989,6049411,6052301,6055373,6058457,6061553,6064897,6068093,6071207,6074279,6077249,6080443,6083659,6087031,6089957,6093011,6096271,6099257,6102251,6105371,6108617,6111613,6114767,6117821,6121057,6124219,6127403,6130441,6133643,6136751,6139853,6142987,6146141,6149321,6152269,6155419,6158507,6161509,6164779,6167783,6170837,6174017,6177181,6180271,6183691,6186871,6190007,6193367,6196391,6199321,6202367,6205427,6208633,6211831,6215063,6218297,6221543,6224627,6227743,6230909,6233963,6237019,6240233,6243383,6246533,6249833,6252901,6255943,6258877,6262117,6265019,6268289,6271301,6274531,6277591,6280739,6283583,6286691,6289849,6293011,6296009,6298811,6301861,6304897,6308039,6311203,6314699,6317657,6320731,6323791,6326893,6329927,6333013,6336227,6339287,6342551,6345763,6349037,6352079,6355213,6358271,6361657,6364807,6367853,6371117,6374513,6377773,6380977,6384067,6387463,6390577,6393787,6396911,6399821,6403051,6406123,6409297,6412459,6415697,6418759,6421873,6424937,6428041,6431401,6434647,6437909,6441031,6444169,6447293,6450491,6453437,6456509,6459683,6462769,6465937,6469091,6472309,6475597,6478607,6481873,6484853,6488249,6491153,6494473,6497539,6500537,6503507,6506891,6510011,6512911,6516281,6519329,6522499,6525647,6528793,6531703,6535099,6538171,6541373,6544427,6547469,6550741,6553979,6557179,6560069,6563087,6566363,6569543,6572677,6575783,6578857,6581963,6584791,6587923,6591367,6594361,6597583,6600667,6603761,6606739,6609989,6613001,6615979,6618959,6622339,6625603,6628711,6631913,6635221,6638341,6641473,6644543,6647653,6651101,6654211,6657407,6660721,6663827,6667019,6670033,6673321,6676331,6679523,6682769,6685969,6689281,6692281,6695441,6698491,6701627,6704791,6707717,6710783,6713947,6716923,6720271,6723113,6726221,6729473,6732623,6735667,6738889,6742117,6745241,6748279,6751399,6754537,6757523,6760423,6763763,6767051,6770161,6773359,6776611,6779683,6782921,6786061,6789203,6792739,6795847,6798947,6802121,6805157,6808097,6811361,6814361,6817619,6820579,6823823,6827017,6830093,6833209,6836503,6839659,6842681,6845809,6849061,6852203,6855157,6858179,6861271,6864191,6867139,6870433,6873653,6876767,6879973,6882923,6885973,6889219,6892211,6895393,6898667,6901823,6905167,6908281,6911323,6914569,6917773,6920651,6923893,6927133,6930379,6933527,6936557,6939511,6942721,6945949,6948923,6951943,6954839,6958207,6961447,6964481,6967577,6970841,6973913,6977107,6980269,6983567,6986761,6989813,6993131,6996103,6999203,7002491,7005697,7008779,7012141,7015417,7018351,7021367,7024543,7027723,7030631,7033751,7036819,7039873,7042873,7045963,7049039,7052113,7055303,7058537,7061701,7065211,7068533,7071587,7074607,7077731,7080893,7084097,7087207,7090151,7093459,7096657,7099739,7102633,7105697,7108859,7112003,7115117,7118387,7121731,7124759,7128269,7131629,7134857,7137853,7141153,7144153,7147397,7150543,7153649,7156883,7159921,7163267,7166377,7169471,7172597,7175677,7179101,7182271,7185421,7188583,7191827,7195079,7198159,7201153,7204271,7207561,7210759,7213841,7217033,7220263,7223417,7226431,7229711,7233029,7236209,7239311,7242359,7245503,7248551,7251779,7254857,7258081,7261313,7264351,7267417,7270733,7273759,7276853,7280033,7283291,7286429,7289449,7292501,7295779,7298897,7302187,7305407,7308451,7311823,7315003,7317881,7321091,7324381,7327469,7330669,7333891,7336919,7340317,7343617,7346917,7350059,7353127,7356191,7359389,7362427,7365697,7368787,7372009,7374989,7378121,7381217,7384253,7387799,7390913,7394239,7397381,7400567,7403771,7407061,7410281,7413443,7416313,7419637,7422719,7425911,7429013,7432093,7435291,7438619,7441691,7444673,7447789,7450843,7454107,7457309,7460641,7463921,7467253,7470461,7473811,7476613,7479697,7482877,7486043,7489189,7492547,7495931,7499029,7502251,7505357,7508573,7511969,7515073,7517953,7521341,7524679,7528121,7531019,7534103,7537259,7540517,7543511,7546681,7549651,7552729,7556047,7559173,7562329,7565669,7569017,7571833,7575383,7578559,7581683,7585021,7588067,7591277,7594289,7597393,7600459,7603567,7606561,7609639,7612789,7616263,7619389,7622873,7625689,7628581,7631881,7635139,7638403,7641637,7644653,7647883,7650961,7654139,7657379,7660423,7663693,7666787,7670023,7673047,7676377,7679521,7682687,7685801,7688951,7692089,7695221,7698289,7701523,7704713,7708081,7711229,7714307,7717399,7720429,7723543,7726903,7730101,7733393,7736551,7739929,7743179,7746341,7749493,7752677,7755817,7759051,7762297,7765343,7768729,7771957,7774829,7778279,7781321,7784633,7787987,7791283,7794421,7797563,7800781,7804007,7806977,7810079,7813129,7816273,7819627,7822739,7825889,7829221,7832411,7835603,7838687,7841807,7844731,7847639,7851037,7854169,7857389,7860557,7863593,7866791,7870141,7873223,7876357,7879423,7882489,7885523,7888649,7891913,7895081,7898377,7901591,7905067,7908023,7911119,7914293,7917449,7920709,7923917,7927069,7930283,7933363,7936673,7939817,7943059,7945967,7949083,7952407,7955719,7959073,7962167,7965281,7968641,7971739,7974917,7977857,7981189,7984253,7987307,7990673,7993883,7997057,8000323,8003537,8006683,8009761,8013029,8016343,8019619,8022689,8025761,8029009,8032399,8035759,8039123,8042063,8045119,8048311,8051717,8054693,8057611,8060849,8063873,8067151,8070397,8073371,8076787,8080027,8083457,8086627,8089673,8093191,8096219,8099639,8102959,8106199,8109319,8112413,8115733,8118731,8121959,8124797,8127793,8131237,8134543,8137813,8141131,8144359,8147687,8150687,8153797,8156867,8160041,8163047,8166107,8169509,8172677,8176019,8179277,8182159,8185237,8188493,8191783,8195017,8198221,8201467,8204587,8207483,8210651,8213747,8216893,8220229,8223353,8226767,8229821,8232899,8236061,8239261,8242261,8245273,8248699,8251819,8255197,8258381,8261809,8265041,8268331,8271371,8274509,8277671,8280763,8283923,8286947,8290421,8293591,8296709,8300057,8303041,8306227,8309533,8312503,8315707,8318983,8322241,8325467,8328583,8331889,8335099,8338241,8341451,8344387,8347373,8350619,8353717,8356993,8360213,8363689,8366933,8369989,8373467,8376661,8379661,8382823,8385809,8389111,8392277,8395441,8398787,8401717,8405233,8408357,8411567,8414737,8418001,8420983,8424137,8427647,8430941,8434087,8437291,8440577,8444041,8447401,8450557,8453681,8456761,8459839,8463061,8466319,8469709,8472943,8476001,8479193,8482259,8485249,8488523,8491621,8494753,8497991,8501221,8504417,8507689,8510707,8513797,8517037,8520157,8523311,8526251,8529601,8532773,8535743,8539057,8542243,8545337,8548523,8551819,8554669,8558003,8561299,8564593,8567989,8570983,8573843,8576903,8580101,8583167,8586559,8589773,8592949,8596193,8599319,8602511,8605691,8608841,8611789,8614973,8618237,8621491,8624633,8627851,8631229,8634467,8637481,8640679,8643923,8647367,8650517,8653529,8656433,8659741,8662597,8666153,8669317,8672509,8676013,8679271,8682467,8685569,8688593,8691833,8695013,8698133,8701349,8704613,8707661,8710963,8714003,8717117,8720233,8723423,8726527,8729801,8732831,8736191,8739433,8742541,8745829,8749087,8752273,8755699,8758721,8761721,8764787,8767963,8771071,8774149,8777543,8780879,8783771,8786887,8790079,8793431,8796637,8799919,8803169,8806327,8809639,8812997,8816083,8819381,8822647,8825743,8828669,8831987,8835371,8838617,8841881,8845157,8848163,8851529,8854607,8857973,8861249,8864503,8867893,8871101,8874053,8877329,8880457,8883691,8886929,8890229,8893361,8896483,8899609,8903033,8906489,8909497,8912627,8915717,8918939,8922149,8925097,8928169,8931493,8934631,8937763,8940917,8944249,8947481,8950759,8953729,8956939,8960453,8963831,8966869,8970289,8973413,8976589,8979889,8982973,8986127,8989117,8992441,8995451,8998643,9001999,9005429,9008771,9012121,9015301,9018683,9021709,9025013,9028429,9031537,9034691,9037909,9041083,9044417,9047321,9050827,9054167,9057427,9060629,9063797,9067087,9070153,9073357,9076799,9079969,9082949,9086191,9089141,9092261,9095543,9099017,9101903,9104989,9108427,9111629,9115069,9118313,9121439,9125021,9128029,9131387,9134501,9137573,9140497,9143767,9146779,9150209,9153341,9156701,9160061,9163397,9166393,9169561,9172861,9176099,9179111,9182281,9185507,9188717,9191867,9195143,9198169,9201281,9204751,9207901,9211141,9214181,9217441,9220481,9223583,9226759,9229889,9233047,9236251,9239423,9242657,9246047,9249217,9252241,9255479,9258433,9261829,9265169,9268423,9271499,9274697,9277979,9281011,9284323,9287573,9290987,9294179,9297259,9300451,9303377,9306797,9310087,9313079,9316211,9319697,9323107,9326137,9329407,9332749,9335933,9338863,9342371,9345547,9348463,9351571,9354887,9358043,9361217,9364409,9367637,9370769,9374083,9377419,9380669,9383887,9387071,9390203,9393557,9396823,9399989,9403301,9406393,9409753,9412943,9416227,9419413,9422599,9425963,9429179,9432509,9435859,9439117,9442229,9445411,9448627,9451627,9455053,9458509,9461657,9464887,9468227,9471283,9474461,9477667,9480937,9484399,9487409,9490661,9493853,9497063,9500347,9503411,9506437,9509693,9512873,9516121,9519509,9522577,9525991,9529361,9532349,9535433,9538877,9541901,9545227,9548311,9551753,9554879,9557971,9561221,9564691,9567913,9571027,9574193,9577297,9580453,9583297,9586229,9589507,9592619,9596099,9599167,9602443,9605647,9609037,9612523,9615511,9618643,9621979,9624943,9628163,9631471,9634841,9638021,9641293,9644573,9647501,9650573,9654017,9657233,9660397,9663679,9666719,9669677,9673093,9676427,9679457,9682597,9685889,9689093,9692443,9695701,9699203,9702403,9705733,9708833,9711893,9715309,9718727,9721871,9725141,9728231,9731081,9734411,9737509,9740741,9743963,9747149,9750371,9753661,9757049,9760151,9763393,9766847,9770113,9773441,9776639,9779941,9783101,9786379,9789557,9792719,9795809,9799057,9802097,9805177,9808391,9811819,9815173,9818183,9821173,9824701,9827821,9830929,9834173,9837433,9840709,9844277,9847463,9850723,9854087,9857377,9860437,9863599,9866741,9870173,9873389,9876781,9879959,9883177,9886553,9889687,9892823,9895961,9899291,9902539,9905717,9909191,9912407,9915679,9918851,9922151,9925439,9928747,9931913,9934927,9938233,9941293,9944531,9947999,9951163,9954341,9957683,9961033,9964259,9967409,9970607,9974021,9977237,9980317,9983983,9987121,9990727,9993869,9997087,10000439,10003571,10006741,10010089,10013287,10016407,10019717,10022693,10025831,10029091,10032497,10035601,10038773,10041947,10045073,10048211,10051421,10054549,10057793,10061063,10064081,10067507,10070891,10074061,10077247,10080377,10083497,10086767,10089967,10093309,10096577,10099729,10102973,10106387,10109507,10112689,10115993,10119217,10122433,10125439,10128773,10132021,10135421,10138441,10141601,10144601,10147939,10151017,10154377,10157681,10160861,10164163,10167551,10170767,10174127,10177267,10180553,10183879,10186919,10190501,10193809,10197101,10200469,10203493,10206797,10210223,10213451,10216799,10220129,10223209,10226371,10229363,10232603,10235593,10239079,10242487,10245637,10248899,10252117,10255181,10258459,10261597,10264697,10267897,10271071,10274177,10277417,10280807,10284077,10287359,10290583,10293863,10296973,10300447,10303859,10306997,10310107,10313707,10316843,10319783,10323143,10326347,10329547,10332557,10335883,10339033,10342039,10345649,10348999,10352183,10355489,10358737,10361749,10365041,10368313,10371287,10374647,10378021,10381321,10384519,10387589,10390823,10394051,10396973,10400263,10403251,10406729,10410139,10413199,10416209,10419481,10422787,10426043,10429187,10432283,10435619,10438819,10442197,10445287,10448567,10451939,10455001,10458089,10461553,10464749,10467757,10470853,10474171,10477289,10480661,10483909,10487119,10490189,10493279,10496609,10499851,10503061,10506281,10509467,10512779,10515821,10519111,10522549,10525721,10529231,10532407,10535773,10538911,10542157,10545421,10548341,10551559,10554857,10558099,10561279,10564403,10567517,10570841,10574129,10577557,10580651,10584019,10587179,10590449,10593647,10596893,10600151,10603517,10606613,10610069,10613257,10616323,10619957,10623131,10626167,10629329,10632619,10635809,10639147,10642267,10645577,10648513,10651679,10655087,10658419,10661543,10664957,10668083,10671197,10674151,10677281,10680587,10683857,10686889,10689983,10693351,10696661,10699921,10702987,10706233,10709411,10712587,10715609,10718683,10721903,10725409,10728589,10732003,10735441,10738523,10741597,10745023,10748321,10751417,10754797,10758131,10761379,10764709,10767941,10771487,10774721,10777931,10781131,10784383,10787731,10791133,10794389,10797559,10800739,10803967,10807157,10810427,10813469,10816727,10820179,10823567,10826723,10830161,10833371,10836431,10839607,10842679,10845899,10849049,10852123,10855589,10858987,10862011,10865149,10868521,10871537,10875089,10878323,10881733,10885051,10888217,10891487,10894817,10897891,10901069,10904039,10907357,10910609,10914023,10917307,10920541,10923617,10926739,10929901,10933369,10936511,10939703,10942961,10945903,10949189,10952533,10955713,10959061,10962181,10965359,10968649,10972141,10975507,10978609,10981771,10984889,10988279,10991713,10994747,10998023,11001257,11004377,11007853,11011193,11014501,11017973,11021081,11024357,11027503,11030881,11034203,11037491,11040707,11043881,11047033,11050307,11053411,11056729,11059687,11062957,11066089,11069293,11072767,11075749,11078909,11082163,11085491,11088859,11091889,11095103,11098247,11101421,11104823,11108087,11110937,11114329,11117569,11120761,11124497,11127887,11131177,11134531,11137871,11141083,11144303,11147483,11150569,11153843,11156989,11160301,11163329,11166577,11169857,11173067,11176147,11179247,11182579,11185679,11189117,11192101,11195507,11198821,11201947,11205179,11208517,11211751,11215271,11218439,11221549,11224933,11228227,11231777,11234813,11238203,11241341,11244581,11247881,11250937,11254021,11257313,11260747,11263793,11267197,11270617,11273989,11277311,11280767,11283893,11287063,11290297,11293193,11296463,11299993,11303401,11306563,11309941,11312993,11316289,11319677,11322797,11325869,11329049,11332487,11335817,11339047,11342543,11345723,11348977,11351981,11355287,11358539,11361871,11365099,11368519,11371757,11374967,11378413,11381621,11384831,11388227,11391623,11394473,11397817,11401081,11404301,11407741,11410969,11414251,11417513,11420533,11423851,11427089,11430313,11433931,11437207,11440397,11443591,11446829,11450161,11453467,11456477,11459533,11462747,11466031,11469197,11472319,11475481,11478767,11482033,11485571,11488853,11492081,11495321,11498507,11501681,11504921,11508407,11511733,11515079,11518399,11521717,11524847,11527897,11531141,11534309,11537587,11540597,11543549,11546917,11550169,11553401,11556767,11559973,11563183,11566381,11569739,11572963,11576347,11579527,11582833,11585837,11589091,11592311,11595667,11599009,11602363,11605369,11608511,11611367,11614661,11617609,11620823,11623939,11627219,11630501,11634121,11637559,11641103,11644301,11647477,11650739,11653699,11656933,11660177,11663371,11666737,11670037,11673229,11676673,11680187,11683501,11686469,11689781,11693023,11696303,11699539,11702527,11705891,11709197,11712457,11715827,11719021,11722283,11725663,11728939,11732351,11735341,11738647,11741843,11745133,11748439,11751541,11754961,11758189,11761469,11764723,11768167,11771453,11774731,11778353,11781241,11784259,11787331,11790661,11794049,11797301,11800417,11803549,11806693,11809999,11813441,11816573,11819833,11823181,11826431,11829463,11833009,11836469,11839609,11843269,11846579,11849707,11852921,11856419,11859433,11862673,11865613,11869021,11872271,11875621,11878709,11881789,11885201,11888467,11891797,11895199,11898223,11901623,11904721,11907989,11911321,11914627,11917777,11921083,11924377,11927347,11930483,11933939,11937257,11940589,11943787,11946829,11950111,11953187,11956369,11959487,11962721,11966111,11969387,11972993,11976047,11979559,11982689,11985767,11989039,11992339,11995661,11998843,12002329,12005761,12009119,12012137,12015373,12018529,12022007,12025283,12028637,12031867,12035119,12038489,12041633,12044941,12048221,12051409,12054761,12057887,12060889,12064097,12067369,12070979,12074113,12077333,12080699,12084041,12087367,12090563,12094039,12097411,12100729,12103913,12107149,12110401,12113483,12116719,12120047,12123211,12126629,12129989,12133321,12136609,12139679,12142679,12145853,12149107,12152417,12155837,12159011,12162253,12165721,12169037,12172361,12175367,12179047,12182257,12185419,12188653,12191899,12195257,12198761,12201923,12205217,12208421,12211669,12214681,12217943,12221207,12224557,12227801,12230893,12233803,12237439,12240763,12244091,12247423,12250769,12254131,12257417,12260483,12263813,12267037,12270319,12273397,12276697,12280057,12283549,12286607,12289891,12292967,12296381,12299519,12302863,12305987,12309053,12312043,12315299,12318539,12321649,12325057,12328507,12331859,12335173,12338621,12342073,12345373,12348587,12351803,12355099,12358069,12361451,12364283,12367339,12370439,12373871,12377177,12380273,12383491,12386929,12390401,12393473,12396749,12399983,12403273,12406657,12409697,12412793,12415999,12419359,12422341,12425741,12429061,12432449,12435679,12439081,12442301,12445501,12448769,12452101,12455419,12458639,12461737,12464971,12468571,12471917,12475103,12478201,12481421,12484547,12488051,12491201,12494617,12498263,12501823,12505133,12508361,12511757,12514949,12517931,12521009,12524063,12527467,12530729,12534191,12537719,12541073,12544097,12547427,12550789,12553901,12557173,12560641,12564077,12567419,12570553,12574063,12577181,12580433,12583657,12586859,12590087,12593363,12596681,12599969,12603127,12606343,12609523,12612559,12616129,12619129,12622537,12625903,12629131,12632299,12635587,12638779,12642031,12645499,12648719,12651923,12655567,12658649,12662047,12665363,12668809,12672029,12675253,12678353,12681407,12684713,12688133,12691337,12694753,12697981,12701099,12704551,12708011,12711001,12714187,12717239,12720361,12723649,12726929,12730379,12733337,12736613,12739799,12742957,12746231,12749557,12752951,12755989,12759389,12762469,12765901,12769109,12772259,12775549,12778681,12781919,12785369,12788683,12792083,12795241,12798427,12801647,12804931,12808183,12811597,12814993,12818161,12821581,12824729,12827981,12831127,12834331,12837661,12840811,12844309,12847433,12850573,12853991,12857071,12860539,12863689,12866831,12870079,12873229,12876659,12880121,12883561,12887009,12890177,12893281,12896743,12900089,12903557,12906847,12910193,12913471,12916901,12919957,12923381,12926857,12930031,12933359,12936653,12939967,12943327,12946607,12949927,12953159,12956351,12959761,12963091,12966293,12969731,12972959,12976141,12979583,12983153,12986377,12989777,12992857,12996131,12999191,13002439,13005623,13008811,13012261,13015559,13018639,13021751,13025183,13028539,13032023,13035461,13038523,13041893,13045391,13048561,13051763,13055069,13058561,13062017,13065337,13068799,13072013,13075177,13078477,13081841,13085249,13088423,13091831,13095431,13098541,13101983,13105247,13108181,13111601,13115017,13118419,13121683,13124957,13128139,13131329,13134661,13137869,13141039,13144267,13147711,13150981,13154201,13157659,13160971,13164419,13167767,13171163,13174267,13177433,13180589,13183943,13186993,13190263,13193519,13196819,13199981,13203277,13206563,13209871,13213139,13216337,13219777,13222763,13226159,13229389,13232657,13236037,13239407,13242787,13246117,13249153,13252627,13255679,13259377,13262693,13265911,13269337,13272617,13275607,13278883,13282211,13285361,13288777,13292281,13295677,13298809,13301983,13305181,13308343,13311643,13314869,13318043,13321229,13324867,13328141,13331557,13334569,13337803,13341187,13344451,13347767,13351067,13354403,13357573,13360931,13363849,13367239,13370569,13373953,13376983,13380317,13383533,13386991,13390259,13393559,13396723,13399877,13403267,13406527,13410139,13413503,13416719,13420049,13423493,13426493,13430089,13433207,13436377,13439477,13443071,13446599,13449697,13453313,13456603,13459727,13463183,13466627,13469849,13472947,13476431,13479527,13482919,13486091,13489561,13492693,13496051,13499399,13502773,13506011,13509367,13512769,13516039,13519283,13522583,13525937,13529141,13532587,13535813,13539059,13542323,13545797,13549181,13552271,13555669,13558871,13562177,13565627,13568977,13572011,13575449,13578601,13581973,13585279,13588247,13591489,13594897,13598257,13601563,13604713,13607689,13610969,13614001,13617473,13620833,13624231,13627717,13630769,13633913,13637251,13640567,13643801,13647169,13650547,13653781,13656989,13660043,13663577,13666711,13669741,13672873,13676183,13679431,13682791,13686229,13689283,13692551,13696019,13699409,13702817,13705831,13709041,13712483,13715813,13718951,13722157,13725487,13728823,13732057,13735679,13738931,13742387,13745689,13748807,13751909,13755013,13758397,13761907,13765237,13768411,13771801,13775291,13778671,13781731,13784923,13787951,13791209,13794233,13797521,13801199,13804513,13807559,13810847,13814303,13817459,13820713,13824091,13827397,13830667,13834103,13837517,13840781,13843877,13846961,13850027,13853393,13856861,13860079,13863203,13866863,13869839,13873217,13876477,13879651,13882949,13886141,13889383,13892737,13895963,13899209,13902241,13905491,13908841,13912007,13915397,13918633,13921849,13924931,13928443,13931821,13935017,13938383,13941743,13945237,13948411,13951733,13955323,13958641,13961917,13965253,13968547,13971907,13975399,13978823,13982063,13985317,13988641,13992203,13995629,13998679,14002141,14005507,14008811,14011903,14015347,14018647,14021939,14025199,14028263,14031581,14034791,14038177,14041421,14044939,14048291,14051641,14054939,14058547,14061503,14064889,14068183,14071591,14074531,14077969,14081183,14084297,14087779,14090983,14094253,14097583,14100851,14104291,14107507,14110489,14113591,14117189,14120269,14123671,14126977,14130107,14133461,14136709,14139823,14143043,14146591,14149957,14153389,14156591,14159867,14163143,14166583,14169847,14173079,14176577,14179699,14183201,14186537,14189899,14193583,14196733,14200079,14203543,14206769,14209957,14213267,14216563,14219789,14223227,14226409,14230057,14233189,14236217,14239399,14242751,14246137,14249387,14252569,14255933,14259227,14262433,14265623,14269027,14272507,14275543,14278717,14281951,14285111,14288441,14291723,14295077,14298371,14301761,14305063,14308519,14311663,14314957,14317951,14321521,14325013,14328269,14331371,14334641,14337959,14341279,14344529,14347841,14350939,14353789,14357009,14360273,14363627,14366867,14370247,14373707,14376911,14380111,14383381,14386391,14389643,14392801,14396119,14399383,14402777,14406131,14409457,14412709,14416063,14419277,14422703,14425907,14429377,14432573,14436083,14439437,14442613,14445841,14449243,14452573,14455759,14459239,14462311,14465911,14469251,14472533,14475847,14478869,14481997,14485351,14488801,14492237,14495549,14498959,14502329,14505397,14508971,14512111,14515643,14519041,14522257,14525573,14528771,14532043,14535439,14538701,14542001,14545337,14548757,14551903,14555269,14558483,14561711,14565097,14568319,14571637,14574719,14578121,14581163,14584411,14587871,14591029,14594369,14597437,14600767,14604181,14607583,14610991,14614387,14617649,14621099,14624549,14628067,14631307,14634583,14637871,14641219,14644423,14648119,14651401,14654687,14657917,14661341,14664569,14667559,14671043,14674321,14677573,14680717,14683793,14687213,14690549,14693827,14697107,14700683,14703947,14707211,14710583,14713939,14717099,14720131,14723659,14727029,14730083,14733451,14736833,14740007,14743307,14746729,14750039,14753251,14756519,14759861,14763169,14766463,14769571,14772787,14775751,14779139,14782343,14785811,14789057,14792207,14795861,14799053,14802497,14805377,14808691,14812279,14815601,14818897,14822231,14825429,14828887,14832107,14835467,14838689,14841779,14844901,14848303,14851871,14855083,14858443,14861681,14864989,14868493,14871629,14875039,14878147,14881861,14885333,14888563,14891857,14895011,14898479,14901797,14905183,14908519,14911991,14915203,14918699,14921911,14925247,14928761,14931811,14935247,14938531,14941679,14944913,14948099,14951149,14954453,14958017,14961689,14965043,14968463,14971741,14975033,14978539,14981789,14985119,14988613,14991707,14994719,14998187,15001607,15004973,15008171,15011467,15014983,15018271,15021551,15024703,15027821,15031151,15034559,15037879,15040999,15044399,15047717,15051041,15054223,15057463,15060911,15064303,15067609,15070831,15074537,15077417,15081107,15084541,15087629,15090799,15094139,15097447,15100741,15104087,15107353,15110791,15114053,15117523,15120757,15124007,15127291,15130723,15133919,15137069,15140621,15144067,15147329,15150533,15153847,15157321,15160589,15163639,15166783,15170027,15173141,15176713,15180083,15183659,15186883,15190243,15193691,15197197,15200441,15203803,15207121,15210439,15213859,15217031,15220327,15223877,15227153,15230377,15233399,15236747,15240067,15243313,15246529,15249887,15253109,15256363,15259609,15263021,15266149,15269489,15272659,15276029,15279193,15282389,15285967,15288961,15292441,15295771,15299143,15302359,15305819,15308963,15312559,15315649,15318907,15322207,15325529,15328949,15332257,15335633,15339113,15342331,15345529,15348701,15352069,15355271,15358643,15361741,15365087,15368449,15372209,15375637,15378901,15382459,15385841,15389081,15392383,15395759,15399361,15402719,15406133,15409447,15412723,15416111,15419293,15422521,15426017,15429371,15432661,15435941,15439423,15442829,15446059,15449689,15452873,15456031,15459487,15462607,15465883,15469313,15472619,15475699,15479111,15482479,15485863,15489107};
long long q[600]={0,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439,1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511,1523,1531,1543,1549,1553,1559,1567,1571,1579,1583,1597,1601,1607,1609,1613,1619,1621,1627,1637,1657,1663,1667,1669,1693,1697,1699,1709,1721,1723,1733,1741,1747,1753,1759,1777,1783,1787,1789,1801,1811,1823,1831,1847,1861,1867,1871,1873,1877,1879,1889,1901,1907,1913,1931,1933,1949,1951,1973,1979,1987,1993,1997,1999,2003,2011,2017,2027,2029,2039,2053,2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521,2531,2539,2543,2549,2551,2557,2579,2591,2593,2609,2617,2621,2633,2647,2657,2659,2663,2671,2677,2683,2687,2689,2693,2699,2707,2711,2713,2719,2729,2731,2741,2749,2753,2767,2777,2789,2791,2797,2801,2803,2819,2833,2837,2843,2851,2857,2861,2879,2887,2897,2903,2909,2917,2927,2939,2953,2957,2963,2969,2971,2999,3001,3011,3019,3023,3037,3041,3049,3061,3067,3079,3083,3089,3109,3119,3121,3137,3163,3167,3169,3181,3187,3191,3203,3209,3217,3221,3229,3251,3253,3257,3259,3271,3299,3301,3307,3313,3319,3323,3329,3331,3343,3347,3359,3361,3371,3373,3389,3391,3407,3413,3433,3449,3457,3461,3463,3467,3469,3491,3499,3511,3517,3527,3529,3533,3539,3541,3547,3557,3559,3571,3581,3583,3593,3607,3613,3617,3623,3631,3637,3643,3659,3671,3673,3677,3691,3697,3701,3709,3719,3727,3733,3739,3761,3767,3769,3779,3793,3797,3803,3821,3823,3833,3847,3851,3853,3863,3877,3881,3889,3907,3911,3917,3919,3923,3929,3931,3943,3947,3967,3989};
long long l,r;
bool tmp;
vector<int>ans;
int main()
{
	freopen ("tinkle.in","r",stdin);
	freopen ("tinkle.out","w",stdout);
	cin>>n>>m;
	if (n<400)
	{
		num=0;
		for (int i=2;;i++)
		{
			tmp=1;
			for (int j=1;j<500;j++)
			{
				if (q[j]>sqrt((double)i))
					break;
				if (i%q[j]==0)
				{
					tmp=0;
					break;
				}
			}
			if (tmp)
			{
				num++;
				if (num>=n-m&&num<=n+m&&num!=n)
				{
					cout<<i<<' ';
					number++;
				}
				if (num>n+m)
					break;
			}
		}
		//cout<<endl<<number;
		return 0;
	}
	else
	{
		num=n/200;
		l=w[num-1]+1;
		r=w[num+1];
		number=(num-1)*200;
		num=551;
		for (int i=l;i<=r;i++)
		{
			tmp=1;
			for (int j=1;j<=num;j++)
			{
				if (q[j]>sqrt((double)i))
					break;
				if (i%q[j]==0)
				{
					tmp=0;
					break;
				}
			}
			if (tmp)
			{
				number++;
				if (number>=n-m&&number<=n+m&&number!=n)
				{
					ans.push_back(i);
				}
				if (number>n+m)
					break;
			}
		}
	}
	//cout<<ans.size()<<endl;
	sort(ans.begin(),ans.end());
	for (int i=0;i<ans.size();i++)
	{
		cout<<ans[i]<<' ';
	}
	return 0;
}
/*
for (long long i=11;;i+=2)
	{
		tmp=1;
		for (int j=1;j<num;j++)
		{
			if (q[j]>sqrt((double)i))
				break;
			if (i%q[j]==0)
			{
				tmp=0;
				break;
			}
		}
		if (tmp)
		{
			q[num]=i;
			num++;
			if (num>1000200)
				break;
		}
	}
	for (int i=1;i<=1000100;)
	{
		cout<<q[i]<<',';
		i+=100;
	}
*/