Sieve code is not working

it says time limit exceeded even after using long long instead of ll, please help, thanks.