-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodeForces-1474B.cpp
More file actions
57 lines (52 loc) · 1.05 KB
/
CodeForces-1474B.cpp
File metadata and controls
57 lines (52 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// Created by abdob on 10/29/2022.
//
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
vector<ll>a;
for(ll i=n+1; ;i++)
{
bool find = true;
for(ll j=2;j*j<=i;j++)
{
if(i%j==0)
{
find=false;
break;
}
}
if(find)
{
a.push_back(i);
break;
}
}
for(ll i= a.back()+n;;i++)
{
bool find = true;
for(ll j=2;j*j<=i;j++)
{
if(i%j==0)
{
find=false;
break;
}
}
if(find)
{
a.push_back(i);
break;
}
}
cout<<min(a[0]*a[1],a[0]*a[0]*a[0])<<endl;
}
}