OJ-Problems-Source/HDOJ/1795_autoAC.cpp
2016-08-17 15:12:28 +08:00

23 lines
6.2 KiB
C++

#include <iostream>
#include <fstream>
using namespace std;
int test[10000] = {1,2,4,6,10,12,16,18,22,28,30,36,40,42,46,52,58,60,66,70,72,78,82,88,96,100,102,106,108,112,126,130,136,138,148,150,156,162,166,172,178,180,190,192,196,198,210,222,226,228,232,238,240,250,256,262,268,270,276,280,282,292,306,310,312,316,330,336,346,348,352,358,366,372,378,382,388,396,400,408,418,420,430,432,438,442,448,456,460,462,466,478,486,490,498,502,508,520,522,540,546,556,562,568,570,576,586,592,598,600,606,612,616,618,630,640,642,646,652,658,660,672,676,682,690,700,708,718,726,732,738,742,750,756,760,768,772,786,796,808,810,820,822,826,828,838,852,856,858,862,876,880,882,886,906,910,918,928,936,940,946,952,966,970,976,982,990,996,1008,1012,1018,1020,1030,1032,1038,1048,1050,1060,1062,1068,1086,1090,1092,1096,1102,1108,1116,1122,1128,1150,1152,1162,1170,1180,1186,1192,1200,1212,1216,1222,1228,1230,1236,1248,1258,1276,1278,1282,1288,1290,1296,1300,1302,1306,1318,1320,1326,1360,1366,1372,1380,1398,1408,1422,1426,1428,1432,1438,1446,1450,1452,1458,1470,1480,1482,1486,1488,1492,1498,1510,1522,1530,1542,1548,1552,1558,1566,1570,1578,1582,1596,1600,1606,1608,1612,1618,1620,1626,1636,1656,1662,1666,1668,1692,1696,1698,1708,1720,1722,1732,1740,1746,1752,1758,1776,1782,1786,1788,1800,1810,1822,1830,1846,1860,1866,1870,1872,1876,1878,1888,1900,1906,1912,1930,1932,1948,1950,1972,1978,1986,1992,1996,1998,2002,2010,2016,2026,2028,2038,2052,2062,2068,2080,2082,2086,2088,2098,2110,2112,2128,2130,2136,2140,2142,2152,2160,2178,2202,2206,2212,2220,2236,2238,2242,2250,2266,2268,2272,2280,2286,2292,2296,2308,2310,2332,2338,2340,2346,2350,2356,2370,2376,2380,2382,2388,2392,2398,2410,2416,2422,2436,2440,2446,2458,2466,2472,2476,2502,2520,2530,2538,2542,2548,2550,2556,2578,2590,2592,2608,2616,2620,2632,2646,2656,2658,2662,2670,2676,2682,2686,2688,2692,2698,2706,2710,2712,2718,2728,2730,2740,2748,2752,2766,2776,2788,2790,2796,2800,2802,2818,2832,2836,2842,2850,2856,2860,2878,2886,2896,2902,2908,2916,2926,2938,2952,2956,2962,2968,2970,2998,3000,3010,3018,3022,3036,3040,3048,3060,3066,3078,3082,3088,3108,3118,3120,3136,3162,3166,3168,3180,3186,3190,3202,3208,3216,3220,3228,3250,3252,3256,3258,3270,3298,3300,3306,3312,3318,3322,3328,3330,3342,3346,3358,3360,3370,3372,3388,3390,3406,3412,3432,3448,3456,3460,3462,3466,3468,3490,3498,3510,3516,3526,3528,3532,3538,3540,3546,3556,3558,3570,3580,3582,3592,3606,3612,3616,3622,3630,3636,3642,3658,3670,3672,3676,3690,3696,3700,3708,3718,3726,3732,3738,3760,3766,3768,3778,3792,3796,3802,3820,3822,3832,3846,3850,3852,3862,3876,3880,3888,3906,3910,3916,3918,3922,3928,3930,3942,3946,3966,3988,4000,4002,4006,4012,4018,4020,4026,4048,4050,4056,4072,4078,4090,4092,4098,4110,4126,4128,4132,4138,4152,4156,4158,4176,4200,4210,4216,4218,4228,4230,4240,4242,4252,4258,4260,4270,4272,4282,4288,4296,4326,4336,4338,4348,4356,4362,4372,4390,4396,4408,4420,4422,4440,4446,4450,4456,4462,4480,4482,4492,4506,4512,4516,4518,4522,4546,4548,4560,4566,4582,4590,4596,4602,4620,4636,4638,4642,4648,4650,4656,4662,4672,4678,4690,4702,4720,4722,4728,4732,4750,4758,4782,4786,4788,4792,4798,4800,4812,4816,4830,4860,4870,4876,4888,4902,4908,4918,4930,4932,4936,4942,4950,4956,4966,4968,4972,4986,4992,4998,5002,5008,5010,5020,5022,5038,5050,5058,5076,5080,5086,5098,5100,5106,5112,5118,5146,5152,5166,5170,5178,5188,5196,5208,5226,5230,5232,5236,5260,5272,5278,5280,5296,5302,5308,5322,5332,5346,5350,5380,5386,5392,5398,5406,5412,5416,5418,5430,5436,5440,5442,5448,5470,5476,5478,5482,5500,5502,5506,5518,5520,5526,5530,5556,5562,5568,5572,5580,5590,5622,5638,5640,5646,5650,5652,5656,5658,5668,5682,5688,5692,5700,5710,5716,5736,5740,5742,5748,5778,5782,5790,5800,5806,5812,5820,5826,5838,5842,5848,5850,5856,5860,5866,5868,5878,5880,5896,5902,5922,5926,5938,5952,5980,5986,6006,6010,6028,6036,6042,6046,6052,6066,6072,6078,6088,6090,6100,6112,6120,6130,6132,6142,6150,6162,6172,6196,6198,6202,6210,6216,6220,6228,6246,6256,6262,6268,6270,6276,6286,6298,6300,6310,6316,6322,6328,6336,6342,6352,6358,6360,6366,6372,6378,6388,6396,6420,6426,6448,6450,6468,6472,6480,6490,6520,6528,6546,6550,6552,6562,6568,6570,6576,6580,6598,6606,6618,6636,6652,6658,6660,6672,6678,6688,6690,6700,6702,6708,6718,6732,6736,6760,6762,6778,6780,6790,6792,6802,6822,6826,6828,6832,6840,6856,6862,6868,6870,6882,6898,6906,6910,6916,6946,6948,6958,6960,6966,6970,6976,6982,6990,6996,7000,7012,7018,7026,7038,7042,7056,7068,7078,7102,7108,7120,7126,7128,7150,7158,7176,7186,7192,7206,7210,7212,7218,7228,7236,7242,7246,7252,7282,7296,7306,7308,7320,7330,7332,7348,7350,7368,7392,7410,7416,7432,7450,7456,7458,7476,7480,7486,7488,7498,7506,7516,7522,7528,7536,7540,7546,7548,7558,7560,7572,7576,7582,7588,7590,7602,7606,7620,7638,7642,7648,7668,7672,7680,7686,7690,7698,7702,7716,7722,7726,7740,7752,7756,7758,7788,7792,7816,7822,7828,7840,7852,7866,7872,7876,7878,7882,7900,7906,7918,7926,7932,7936,7948,7950,7962,7992,8008,8010,8016,8038,8052,8058,8068,8080,8086,8088,8092,8100,8110,8116,8122,8146,8160,8166,8170,8178,8190,8208,8218,8220,8230,8232,8236,8242,8262,8268,8272,8286,8290,8292,8296,8310,8316,8328,8352,8362,8368,8376,8386,8388,8418,8422,8428,8430,8442,8446,8460,8466,8500,8512,8520,8526,8536,8538,8542,8562,8572,8580,8596,8598,8608,8622,8626,8628,8640,8646,8662,8668,8676,8680,8688,8692,8698,8706,8712,8718,8730,8736,8740,8746,8752,8760,8778,8782,8802,8806,8818,8820,8830,8836,8838,8848,8860,8862,8866,8886,8892,8922,8928,8932,8940,8950,8962,8968,8970,8998,9000,9006,9010,9012,9028,9040,9042,9048,9058,9066,9090,9102,9108,9126,9132,9136,9150,9156,9160,9172,9180,9186,9198,9202,9208,9220,9226,9238,9240,9256,9276,9280,9282,9292,9310,9318,9322,9336,9340,9342,9348,9370,9376,9390,9396,9402,9412,9418,9420,9430,9432,9436,9438,9460,9462,9466,9472,9478,9490,9496,9510,9520,9532,9538,9546,9550,9586,9600,9612,9618,9622,9628,9630,9642,9648,9660,9676,9678,9688,9696,9718,9720,9732,9738,9742,9748,9766,9768,9780,9786,9790,9802,9810,9816,9828,9832,9838,9850,9856,9858,9870,9882,9886,9900,9906,9922,9928,9930,9940,9948,9966,9972,10006};
int main()
{
int Q;
cin >> Q;
while(Q--)
{
int n;
cin >> n;
for(int i=0;i<10000;i++)
{
if(n<=test[i])
{
cout << test[i]+1 << endl;
break;
}
}
}
}