Even and odd divisor problem

I m getting wrong answer.

@Affan-Mokarram-202031887744398 your solution will fail as you are using a n*sqrt(n) approach. You are intended to use a seive for precomputation for storing the answers and printing the query in 0(1) time. You can have a look at this code for reference.