/* Approach of this question */

void solve()

{

ll cnt = 0;

for (ll i = 2; i <= 31622; i++)

{

if (isPrime[i] == true)

{

ans.PB(i * i * i * i);

}

}

}

int main()

{

boost;

int T;

cin >> T;

SieveOfEratosthenes(MAX); //prime numbers

solve();

while (T–)

{

ll n;

cin >> n; // UB -> upper_bound

cout << UB(ans.begin(), ans.end(), n) - ans.begin() << endl;

```
}
return 0;
```

}

why above code give AC for this problem?

https://www.codechef.com/RC152020/problems/REC15B/