Please have a look into this problem:Little Dipu is a small kid and like all the other kids, he likes to  play, but he plays with numbers (he is extraordinary you know).  Nowadays Dipu has some extra interest in odd numbers. So, he says that  a number N is interesting if it has odd number of divisors. Now Dipu  turns to you and asks you to tell him how many interesting numbers are  there between two given numbers, L and R (both inclusive). Input:First line of input contains the number of test cases T. Each of the  next T lines contains two space separated integers L and R. Output:For each test case, output an integer, denoting the count of  interesting numbers between L and R (both inclusive).Constraints:\$1 \le T \le 100000\$\$1 \le L \le R \le 1018\$Sample input:21 36 10Sample output:11Below is a solution that I have come up with:#include<stdio.h>int main(){  long long int max,testcase,count,l,r;  scanf(%lld,&testcase);  while(testcase-->0)  {    max=0;    scanf(%lld %lld,&l,&r);    for(int i=l;i<=r;i++)    {      count=0;      for(int j=1;j<=i;j++)      {        if(i%j==0)        {        count++;        }      }      if(count%2!=0)      {          max=max+1;      }    }    printf(%lld\n,max);  }}The problem is the input constraint which is very large indeed, so my program will give the right outputs for some test cases but for larger inputs it will exceed the time allocated. Please help me to come up with another logic if possible which will make sure that the time allocated is not exceeded.My program produces the right output but for larger inputs it takes more time than it should.
Number of interesting numbers between two given numbers
algorithm;c;programming challenge;time limit exceeded