#include
#define ll long long
using namespace std;
// Sieve Approach - Generate an array containing prime numbers
void prime_sieve(int p){
// First mark all the odd numbers as potential prime numbers
for(int i=3;i<=1000;i=+2){
p[i]=1; // Initialize all values as 1
}
// Sieve Code
for(int i=3;i<=1000;i+=2){
// If the current number is not marked (It is a prime number)
if(p[i]==1){
// mark all the multiples of i as not prime
for(int j=ii;j<=1000;j+=i){
p[j]=0; // Mark the values as 0 that are not prime
}
}
}
// Some Special Cases
p[2]=1;
p[1]=p[0]=0;
}
int main(){
int p[1005]={0};
prime_sieve§;
int csum[1000]={0};
// lets print all prime numbers upto range n
for(int i=0;i<=1000;i++){
if(p[i]==1){
cout<<i<<" ";
}
}
/*
// Precompute the primes upto index i
for(int i=1;i<1000;i++){
csum[i]=csum[i-1]+p[i];
}
int q;
cin>>q;
while(q--){
int a,b;
cin>>a>>b;
cout<<csum[b]-csum[a-1]<<endl;
}
*/
return 0;
}