-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntprob4.java
More file actions
31 lines (30 loc) · 839 Bytes
/
Copy pathIntprob4.java
File metadata and controls
31 lines (30 loc) · 839 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
import java.util.*;
import java.io.*;
public class Intprob4{
static ArrayList<Long> primes=new ArrayList<>();
static void see(){
int MAX=200000;
boolean[] isprime=new boolean[MAX];
Arrays.fill(isprime,true);
for(int i=2;i<MAX;i++){
if(isprime[i]){
primes.add((long)i);
for(int j=2*i;j<MAX;j+=i)
isprime[j]=false;
}
}
}
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
see();
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
for(int i=0;i<n;i++){
long a=primes.get(i)*primes.get(i+1);
System.out.print(a+(i==n-1 ? "":" "));
}
System.out.println();
}
}
}