Problem: Link

Submission: Link

Can you point out what’s wrong with my code?

```
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void sieve(ll lowerbound, ll upperbound)
{
map<ll, bool> flag;
ll i = (lowerbound < 2 ? 2 : lowerbound);
for(; i<=upperbound; i++)
{
if(!flag[i]) // if unmarked = prime
{
flag[i] = true;
printf("%lld\n", i);
if(i*i > upperbound)
break;
// mark all multiples of i
for(ll j=i*i; j<=upperbound; j+=i)
flag[j] = true;
}
}
i++;
for(; i<=upperbound; i++)
{
if(!flag[i]){
printf("%lld\n", i);
}
}
}
int main()
{
ll t, a, b;
scanf("%lld", &t);
while(t--)
{
scanf("%lld%lld", &a, &b);
sieve(a, b);
printf("\n");
}
return 0;
}
```