-
Notifications
You must be signed in to change notification settings - Fork 0
/
C.cpp
56 lines (55 loc) · 1006 Bytes
/
C.cpp
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
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
int main()
{
fastio;
long long n,i,j,k,count1=0,count2=999,count3=0,count=0;
long long a[10005],b[10005],c[10005];
for(i=2;i<=1000;i++)
b[i-2]=10*i;
for(i=2;;i++)
{
if(6*i>10000)
break;
if(i%5==0)
continue;
a[count1]=6*i;
count1++;
}
for(i=3;;i=i+2)
{
if(15*i>10000)
break;
c[count3]=15*i;
count3++;
}
cin>>n;
cout<<6<<" "<<10<<" "<<15<<" ";
count=3;
i=0;
j=0;
k=0;
while(count<n)
{
if(i<count1)
{
cout<<a[i]<<" ";
i++;
count++;
}
else if(j<count2)
{
cout<<b[j]<<" ";
j++;
count++;
}
else
{
cout<<c[k]<<" ";
k++;
count++;
}
}
return 0;
}