-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path#5_smallest_multiple.java
More file actions
33 lines (25 loc) · 891 Bytes
/
#5_smallest_multiple.java
File metadata and controls
33 lines (25 loc) · 891 Bytes
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
import java.io.;
import java.util.;
import java.text.;
import java.math.;
import java.util.regex.;
public class Solution {
public static void main(String[] args) {
Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution.
Scanner in = new Scanner(System.in);
int tests = in.nextInt();
for(int test = 1; test=tests; test++){
int n = in.nextInt();
int[] primes = {2,3,5,7,11,13,17,19,23,29,31,37};
int product = 1;
for(int i = 0; primes[i] = n; i++){
int a = primes[i];
while(primes[i]a = n){
a=primes[i];
}
product=a;
}
System.out.println(product);
}
}
}