关于T1
  • 板块灌水区
  • 楼主131354320hy
  • 当前回复5
  • 已保存回复5
  • 发布时间2021/11/20 20:00
  • 上次更新2023/11/3 23:56:25
查看原帖
关于T1
362183
131354320hy楼主2021/11/20 20:00

打表做的,50%的数据不是数据组数小于等于1000吗,一共最多也就循环3439000,为啥会T两个点

#include<iostream> 
#include<cstdio> 
#include<cmath>
#include<cstring> 
#include<algorithm> 
#include<queue> 
#include<vector>
#include<cstdlib>
using namespace std;
int db[3439]={7,17,27,37,47,57,67,70,71,72,73,74,75,76,77,78,79,87,97,107,117,127,137,147,157,167,170,171,172,173,174,175,176,177,178,179,187,197,207,217,227,237,247,257,267,270,271,272,273,274,275,276,277,278,279,287,297,307,317,327,337,347,357,367,370,371,372,373,374,375,376,377,378,379,387,397,407,417,427,437,447,457,467,470,471,472,473,474,475,476,477,478,479,487,497,507,517,527,537,547,557,567,570,571,572,573,574,575,576,577,578,579,587,597,607,617,627,637,647,657,667,670,671,672,673,674,675,676,677,678,679,687,697,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,807,817,827,837,847,857,867,870,871,872,873,874,875,876,877,878,879,887,897,907,917,927,937,947,957,967,970,971,972,973,974,975,976,977,978,979,987,997,1007,1017,1027,1037,1047,1057,1067,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1087,1097,1107,1117,1127,1137,1147,1157,1167,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1187,1197,1207,1217,1227,1237,1247,1257,1267,1270,1271,1272,1273,1274,1275,1276,1277,1278,1279,1287,1297,1307,1317,1327,1337,1347,1357,1367,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1387,1397,1407,1417,1427,1437,1447,1457,1467,1470,1471,1472,1473,1474,1475,1476,1477,1478,1479,1487,1497,1507,1517,1527,1537,1547,1557,1567,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1587,1597,1607,1617,1627,1637,1647,1657,1667,1670,1671,1672,1673,1674,1675,1676,1677,1678,1679,1687,1697,1700,1701,1702,1703,1704,1705,1706,1707,1708,1709,1710,1711,1712,1713,1714,1715,1716,1717,1718,1719,1720,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748,1749,1750,1751,1752,1753,1754,1755,1756,1757,1758,1759,1760,1761,1762,1763,1764,1765,1766,1767,1768,1769,1770,1771,1772,1773,1774,1775,1776,1777,1778,1779,1780,1781,1782,1783,1784,1785,1786,1787,1788,1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1807,1817,1827,1837,1847,1857,1867,1870,1871,1872,1873,1874,1875,1876,1877,1878,1879,1887,1897,1907,1917,1927,1937,1947,1957,1967,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1987,1997,2007,2017,2027,2037,2047,2057,2067,2070,2071,2072,2073,2074,2075,2076,2077,2078,2079,2087,2097,2107,2117,2127,2137,2147,2157,2167,2170,2171,2172,2173,2174,2175,2176,2177,2178,2179,2187,2197,2207,2217,2227,2237,2247,2257,2267,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2287,2297,2307,2317,2327,2337,2347,2357,2367,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2387,2397,2407,2417,2427,2437,2447,2457,2467,2470,2471,2472,2473,2474,2475,2476,2477,2478,2479,2487,2497,2507,2517,2527,2537,2547,2557,2567,2570,2571,2572,2573,2574,2575,2576,2577,2578,2579,2587,2597,2607,2617,2627,2637,2647,2657,2667,2670,2671,2672,2673,2674,2675,2676,2677,2678,2679,2687,2697,2700,2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2711,2712,2713,2714,2715,2716,2717,2718,2719,2720,2721,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2734,2735,2736,2737,2738,2739,2740,2741,2742,2743,2744,2745,2746,2747,2748,2749,2750,2751,2752,2753,2754,2755,2756,2757,2758,2759,2760,2761,2762,2763,2764,2765,2766,2767,2768,2769,2770,2771,2772,2773,2774,2775,2776,2777,2778,2779,2780,2781,2782,2783,2784,2785,2786,2787,2788,2789,2790,2791,2792,2793,2794,2795,2796,2797,2798,2799,2807,2817,2827,2837,2847,2857,2867,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2887,2897,2907,2917,2927,2937,2947,2957,2967,2970,2971,2972,2973,2974,2975,2976,2977,2978,2979,2987,2997,3007,3017,3027,3037,3047,3057,3067,3070,3071,3072,3073,3074,3075,3076,3077,3078,3079,3087,3097,3107,3117,3127,3137,3147,3157,3167,3170,3171,3172,3173,3174,3175,3176,3177,3178,3179,3187,3197,3207,3217,3227,3237,3247,3257,3267,3270,3271,3272,3273,3274,3275,3276,3277,3278,3279,3287,3297,3307,3317,3327,3337,3347,3357,3367,3370,3371,3372,3373,3374,3375,3376,3377,3378,3379,3387,3397,3407,3417,3427,3437,3447,3457,3467,3470,3471,3472,3473,3474,3475,3476,3477,3478,3479,3487,3497,3507,3517,3527,3537,3547,3557,3567,3570,3571,3572,3573,3574,3575,3576,3577,3578,3579,3587,3597,3607,3617,3627,3637,3647,3657,3667,3670,3671,3672,3673,3674,3675,3676,3677,3678,3679,3687,3697,3700,3701,3702,3703,3704,3705,3706,3707,3708,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3719,3720,3721,3722,3723,3724,3725,3726,3727,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3740,3741,3742,3743,3744,3745,3746,3747,3748,3749,3750,3751,3752,3753,3754,3755,3756,3757,3758,3759,3760,3761,3762,3763,3764,3765,3766,3767,3768,3769,3770,3771,3772,3773,3774,3775,3776,3777,3778,3779,3780,3781,3782,3783,3784,3785,3786,3787,3788,3789,3790,3791,3792,3793,3794,3795,3796,3797,3798,3799,3807,3817,3827,3837,3847,3857,3867,3870,3871,3872,3873,3874,3875,3876,3877,3878,3879,3887,3897,3907,3917,3927,3937,3947,3957,3967,3970,3971,3972,3973,3974,3975,3976,3977,3978,3979,3987,3997,4007,4017,4027,4037,4047,4057,4067,4070,4071,4072,4073,4074,4075,4076,4077,4078,4079,4087,4097,4107,4117,4127,4137,4147,4157,4167,4170,4171,4172,4173,4174,4175,4176,4177,4178,4179,4187,4197,4207,4217,4227,4237,4247,4257,4267,4270,4271,4272,4273,4274,4275,4276,4277,4278,4279,4287,4297,4307,4317,4327,4337,4347,4357,4367,4370,4371,4372,4373,4374,4375,4376,4377,4378,4379,4387,4397,4407,4417,4427,4437,4447,4457,4467,4470,4471,4472,4473,4474,4475,4476,4477,4478,4479,4487,4497,4507,4517,4527,4537,4547,4557,4567,4570,4571,4572,4573,4574,4575,4576,4577,4578,4579,4587,4597,4607,4617,4627,4637,4647,4657,4667,4670,4671,4672,4673,4674,4675,4676,4677,4678,4679,4687,4697,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4713,4714,4715,4716,4717,4718,4719,4720,4721,4722,4723,4724,4725,4726,4727,4728,4729,4730,4731,4732,4733,4734,4735,4736,4737,4738,4739,4740,4741,4742,4743,4744,4745,4746,4747,4748,4749,4750,4751,4752,4753,4754,4755,4756,4757,4758,4759,4760,4761,4762,4763,4764,4765,4766,4767,4768,4769,4770,4771,4772,4773,4774,4775,4776,4777,4778,4779,4780,4781,4782,4783,4784,4785,4786,4787,4788,4789,4790,4791,4792,4793,4794,4795,4796,4797,4798,4799,4807,4817,4827,4837,4847,4857,4867,4870,4871,4872,4873,4874,4875,4876,4877,4878,4879,4887,4897,4907,4917,4927,4937,4947,4957,4967,4970,4971,4972,4973,4974,4975,4976,4977,4978,4979,4987,4997,5007,5017,5027,5037,5047,5057,5067,5070,5071,5072,5073,5074,5075,5076,5077,5078,5079,5087,5097,5107,5117,5127,5137,5147,5157,5167,5170,5171,5172,5173,5174,5175,5176,5177,5178,5179,5187,5197,5207,5217,5227,5237,5247,5257,5267,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5287,5297,5307,5317,5327,5337,5347,5357,5367,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379,5387,5397,5407,5417,5427,5437,5447,5457,5467,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5487,5497,5507,5517,5527,5537,5547,5557,5567,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5587,5597,5607,5617,5627,5637,5647,5657,5667,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5687,5697,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728,5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744,5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792,5793,5794,5795,5796,5797,5798,5799,5807,5817,5827,5837,5847,5857,5867,5870,5871,5872,5873,5874,5875,5876,5877,5878,5879,5887,5897,5907,5917,5927,5937,5947,5957,5967,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5987,5997,6007,6017,6027,6037,6047,6057,6067,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6087,6097,6107,6117,6127,6137,6147,6157,6167,6170,6171,6172,6173,6174,6175,6176,6177,6178,6179,6187,6197,6207,6217,6227,6237,6247,6257,6267,6270,6271,6272,6273,6274,6275,6276,6277,6278,6279,6287,6297,6307,6317,6327,6337,6347,6357,6367,6370,6371,6372,6373,6374,6375,6376,6377,6378,6379,6387,6397,6407,6417,6427,6437,6447,6457,6467,6470,6471,6472,6473,6474,6475,6476,6477,6478,6479,6487,6497,6507,6517,6527,6537,6547,6557,6567,6570,6571,6572,6573,6574,6575,6576,6577,6578,6579,6587,6597,6607,6617,6627,6637,6647,6657,6667,6670,6671,6672,6673,6674,6675,6676,6677,6678,6679,6687,6697,6700,6701,6702,6703,6704,6705,6706,6707,6708,6709,6710,6711,6712,6713,6714,6715,6716,6717,6718,6719,6720,6721,6722,6723,6724,6725,6726,6727,6728,6729,6730,6731,6732,6733,6734,6735,6736,6737,6738,6739,6740,6741,6742,6743,6744,6745,6746,6747,6748,6749,6750,6751,6752,6753,6754,6755,6756,6757,6758,6759,6760,6761,6762,6763,6764,6765,6766,6767,6768,6769,6770,6771,6772,6773,6774,6775,6776,6777,6778,6779,6780,6781,6782,6783,6784,6785,6786,6787,6788,6789,6790,6791,6792,6793,6794,6795,6796,6797,6798,6799,6807,6817,6827,6837,6847,6857,6867,6870,6871,6872,6873,6874,6875,6876,6877,6878,6879,6887,6897,6907,6917,6927,6937,6947,6957,6967,6970,6971,6972,6973,6974,6975,6976,6977,6978,6979,6987,6997,7000,7001,7002,7003,7004,7005,7006,7007,7008,7009,7010,7011,7012,7013,7014,7015,7016,7017,7018,7019,7020,7021,7022,7023,7024,7025,7026,7027,7028,7029,7030,7031,7032,7033,7034,7035,7036,7037,7038,7039,7040,7041,7042,7043,7044,7045,7046,7047,7048,7049,7050,7051,7052,7053,7054,7055,7056,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7071,7072,7073,7074,7075,7076,7077,7078,7079,7080,7081,7082,7083,7084,7085,7086,7087,7088,7089,7090,7091,7092,7093,7094,7095,7096,7097,7098,7099,7100,7101,7102,7103,7104,7105,7106,7107,7108,7109,7110,7111,7112,7113,7114,7115,7116,7117,7118,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7129,7130,7131,7132,7133,7134,7135,7136,7137,7138,7139,7140,7141,7142,7143,7144,7145,7146,7147,7148,7149,7150,7151,7152,7153,7154,7155,7156,7157,7158,7159,7160,7161,7162,7163,7164,7165,7166,7167,7168,7169,7170,7171,7172,7173,7174,7175,7176,7177,7178,7179,7180,7181,7182,7183,7184,7185,7186,7187,7188,7189,7190,7191,7192,7193,7194,7195,7196,7197,7198,7199,7200,7201,7202,7203,7204,7205,7206,7207,7208,7209,7210,7211,7212,7213,7214,7215,7216,7217,7218,7219,7220,7221,7222,7223,7224,7225,7226,7227,7228,7229,7230,7231,7232,7233,7234,7235,7236,7237,7238,7239,7240,7241,7242,7243,7244,7245,7246,7247,7248,7249,7250,7251,7252,7253,7254,7255,7256,7257,7258,7259,7260,7261,7262,7263,7264,7265,7266,7267,7268,7269,7270,7271,7272,7273,7274,7275,7276,7277,7278,7279,7280,7281,7282,7283,7284,7285,7286,7287,7288,7289,7290,7291,7292,7293,7294,7295,7296,7297,7298,7299,7300,7301,7302,7303,7304,7305,7306,7307,7308,7309,7310,7311,7312,7313,7314,7315,7316,7317,7318,7319,7320,7321,7322,7323,7324,7325,7326,7327,7328,7329,7330,7331,7332,7333,7334,7335,7336,7337,7338,7339,7340,7341,7342,7343,7344,7345,7346,7347,7348,7349,7350,7351,7352,7353,7354,7355,7356,7357,7358,7359,7360,7361,7362,7363,7364,7365,7366,7367,7368,7369,7370,7371,7372,7373,7374,7375,7376,7377,7378,7379,7380,7381,7382,7383,7384,7385,7386,7387,7388,7389,7390,7391,7392,7393,7394,7395,7396,7397,7398,7399,7400,7401,7402,7403,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7414,7415,7416,7417,7418,7419,7420,7421,7422,7423,7424,7425,7426,7427,7428,7429,7430,7431,7432,7433,7434,7435,7436,7437,7438,7439,7440,7441,7442,7443,7444,7445,7446,7447,7448,7449,7450,7451,7452,7453,7454,7455,7456,7457,7458,7459,7460,7461,7462,7463,7464,7465,7466,7467,7468,7469,7470,7471,7472,7473,7474,7475,7476,7477,7478,7479,7480,7481,7482,7483,7484,7485,7486,7487,7488,7489,7490,7491,7492,7493,7494,7495,7496,7497,7498,7499,7500,7501,7502,7503,7504,7505,7506,7507,7508,7509,7510,7511,7512,7513,7514,7515,7516,7517,7518,7519,7520,7521,7522,7523,7524,7525,7526,7527,7528,7529,7530,7531,7532,7533,7534,7535,7536,7537,7538,7539,7540,7541,7542,7543,7544,7545,7546,7547,7548,7549,7550,7551,7552,7553,7554,7555,7556,7557,7558,7559,7560,7561,7562,7563,7564,7565,7566,7567,7568,7569,7570,7571,7572,7573,7574,7575,7576,7577,7578,7579,7580,7581,7582,7583,7584,7585,7586,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,7646,7647,7648,7649,7650,7651,7652,7653,7654,7655,7656,7657,7658,7659,7660,7661,7662,7663,7664,7665,7666,7667,7668,7669,7670,7671,7672,7673,7674,7675,7676,7677,7678,7679,7680,7681,7682,7683,7684,7685,7686,7687,7688,7689,7690,7691,7692,7693,7694,7695,7696,7697,7698,7699,7700,7701,7702,7703,7704,7705,7706,7707,7708,7709,7710,7711,7712,7713,7714,7715,7716,7717,7718,7719,7720,7721,7722,7723,7724,7725,7726,7727,7728,7729,7730,7731,7732,7733,7734,7735,7736,7737,7738,7739,7740,7741,7742,7743,7744,7745,7746,7747,7748,7749,7750,7751,7752,7753,7754,7755,7756,7757,7758,7759,7760,7761,7762,7763,7764,7765,7766,7767,7768,7769,7770,7771,7772,7773,7774,7775,7776,7777,7778,7779,7780,7781,7782,7783,7784,7785,7786,7787,7788,7789,7790,7791,7792,7793,7794,7795,7796,7797,7798,7799,7800,7801,7802,7803,7804,7805,7806,7807,7808,7809,7810,7811,7812,7813,7814,7815,7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,7832,7833,7834,7835,7836,7837,7838,7839,7840,7841,7842,7843,7844,7845,7846,7847,7848,7849,7850,7851,7852,7853,7854,7855,7856,7857,7858,7859,7860,7861,7862,7863,7864,7865,7866,7867,7868,7869,7870,7871,7872,7873,7874,7875,7876,7877,7878,7879,7880,7881,7882,7883,7884,7885,7886,7887,7888,7889,7890,7891,7892,7893,7894,7895,7896,7897,7898,7899,7900,7901,7902,7903,7904,7905,7906,7907,7908,7909,7910,7911,7912,7913,7914,7915,7916,7917,7918,7919,7920,7921,7922,7923,7924,7925,7926,7927,7928,7929,7930,7931,7932,7933,7934,7935,7936,7937,7938,7939,7940,7941,7942,7943,7944,7945,7946,7947,7948,7949,7950,7951,7952,7953,7954,7955,7956,7957,7958,7959,7960,7961,7962,7963,7964,7965,7966,7967,7968,7969,7970,7971,7972,7973,7974,7975,7976,7977,7978,7979,7980,7981,7982,7983,7984,7985,7986,7987,7988,7989,7990,7991,7992,7993,7994,7995,7996,7997,7998,7999,8007,8017,8027,8037,8047,8057,8067,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8087,8097,8107,8117,8127,8137,8147,8157,8167,8170,8171,8172,8173,8174,8175,8176,8177,8178,8179,8187,8197,8207,8217,8227,8237,8247,8257,8267,8270,8271,8272,8273,8274,8275,8276,8277,8278,8279,8287,8297,8307,8317,8327,8337,8347,8357,8367,8370,8371,8372,8373,8374,8375,8376,8377,8378,8379,8387,8397,8407,8417,8427,8437,8447,8457,8467,8470,8471,8472,8473,8474,8475,8476,8477,8478,8479,8487,8497,8507,8517,8527,8537,8547,8557,8567,8570,8571,8572,8573,8574,8575,8576,8577,8578,8579,8587,8597,8607,8617,8627,8637,8647,8657,8667,8670,8671,8672,8673,8674,8675,8676,8677,8678,8679,8687,8697,8700,8701,8702,8703,8704,8705,8706,8707,8708,8709,8710,8711,8712,8713,8714,8715,8716,8717,8718,8719,8720,8721,8722,8723,8724,8725,8726,8727,8728,8729,8730,8731,8732,8733,8734,8735,8736,8737,8738,8739,8740,8741,8742,8743,8744,8745,8746,8747,8748,8749,8750,8751,8752,8753,8754,8755,8756,8757,8758,8759,8760,8761,8762,8763,8764,8765,8766,8767,8768,8769,8770,8771,8772,8773,8774,8775,8776,8777,8778,8779,8780,8781,8782,8783,8784,8785,8786,8787,8788,8789,8790,8791,8792,8793,8794,8795,8796,8797,8798,8799,8807,8817,8827,8837,8847,8857,8867,8870,8871,8872,8873,8874,8875,8876,8877,8878,8879,8887,8897,8907,8917,8927,8937,8947,8957,8967,8970,8971,8972,8973,8974,8975,8976,8977,8978,8979,8987,8997,9007,9017,9027,9037,9047,9057,9067,9070,9071,9072,9073,9074,9075,9076,9077,9078,9079,9087,9097,9107,9117,9127,9137,9147,9157,9167,9170,9171,9172,9173,9174,9175,9176,9177,9178,9179,9187,9197,9207,9217,9227,9237,9247,9257,9267,9270,9271,9272,9273,9274,9275,9276,9277,9278,9279,9287,9297,9307,9317,9327,9337,9347,9357,9367,9370,9371,9372,9373,9374,9375,9376,9377,9378,9379,9387,9397,9407,9417,9427,9437,9447,9457,9467,9470,9471,9472,9473,9474,9475,9476,9477,9478,9479,9487,9497,9507,9517,9527,9537,9547,9557,9567,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9587,9597,9607,9617,9627,9637,9647,9657,9667,9670,9671,9672,9673,9674,9675,9676,9677,9678,9679,9687,9697,9700,9701,9702,9703,9704,9705,9706,9707,9708,9709,9710,9711,9712,9713,9714,9715,9716,9717,9718,9719,9720,9721,9722,9723,9724,9725,9726,9727,9728,9729,9730,9731,9732,9733,9734,9735,9736,9737,9738,9739,9740,9741,9742,9743,9744,9745,9746,9747,9748,9749,9750,9751,9752,9753,9754,9755,9756,9757,9758,9759,9760,9761,9762,9763,9764,9765,9766,9767,9768,9769,9770,9771,9772,9773,9774,9775,9776,9777,9778,9779,9780,9781,9782,9783,9784,9785,9786,9787,9788,9789,9790,9791,9792,9793,9794,9795,9796,9797,9798,9799,9807,9817,9827,9837,9847,9857,9867,9870,9871,9872,9873,9874,9875,9876,9877,9878,9879,9887,9897,9907,9917,9927,9937,9947,9957,9967,9970,9971,9972,9973,9974,9975,9976,9977,9978,9979,9987,9997};
int i;
bool check(int a)
{
	for(i=0;i<3439;i++)
		{
		if(a%db[i]==0) return true;
		}
	return false;
}
int sz;
int main()
{
//	freopen("number.in","r",stdin);
//	freopen("number.out","w",stdout);
	int n,k=0;
	scanf("%d",&n);
	while(n--)
		{
		scanf("%d",&sz);
		int t=sz;
		while(1)
			{
			if(check(sz))
				{
				cout<<-1<<endl;
				break;
				}
			if(t!=sz&&!check(t))
				{
				cout<<t<<endl;
				break;
				}
			t++;
			}
		}
	return 0;	
} 
2021/11/20 20:00
加载中...