CF1474B.Different Divisors
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Positive integer x is called divisor of positive integer y, if y is divisible by x without remainder. For example, 1 is a divisor of 7 and 3 is not divisor of 8.
We gave you an integer d and asked you to find the smallest positive integer a, such that
- a has at least 4 divisors;
- difference between any two divisors of a is at least d.
正整数 x 被称为正整数 y 的约数,当且仅当 y 能被 x 整除(即余数为 0)。例如,1 是 7 的约数,而 3 不是 8 的约数。
我们给出一个整数 d,要求你找出最小的正整数 a,使得:
- a 至少有 4 个约数;
- a 的任意两个约数之间的差值至少为 d。
输入格式
The first line contains a single integer t (1≤t≤3000) — the number of test cases.
The first line of each test case contains a single integer d (1≤d≤10000).
第一行包含一个整数 t(1≤t≤3000)—— 表示测试用例的数量。
每个测试用例的第一行包含一个整数 d(1≤d≤10000)。
输出格式
For each test case print one integer a — the answer for this test case.
对于每个测试用例,输出一个整数 a —— 该测试用例的答案。
输入输出样例
输入#1
2 1 2
输出#1
6 15
说明/提示
In the first test case, integer 6 have following divisors: [1,2,3,6]. There are 4 of them and the difference between any two of them is at least 1. There is no smaller integer with at least 4 divisors.
In the second test case, integer 15 have following divisors: [1,3,5,15]. There are 4 of them and the difference between any two of them is at least 2.
The answer 12 is INVALID because divisors are [1,2,3,4,6,12]. And the difference between, for example, divisors 2 and 3 is less than d=2.
在第一个测试用例中,整数 6 的所有正因数为:[1,2,3,6]。共有 4 个因数,且其中任意两个因数之差至少为 1。不存在比 6 更小的、至少有 4 个因数的整数。
在第二个测试用例中,整数 15 的所有正因数为:[1,3,5,15]。共有 4 个因数,且其中任意两个因数之差至少为 2。
答案 12 是无效的,因为其因数为 [1,2,3,4,6,12],而例如因数 2 与 3 的差小于 d=2。
输入解题思路,AI测评打分。不知道怎么写?