Problem Description: Caleb likes to challenge Selvan's math ability. He will provide a starting and ending value that describes a range of integers, inclusive of the endpoints. Selvan must determine the number of square integers within that range. Note: A square integer is an integer which is the square of an integer, e.g. 1, 4, 9, 16, 25
C Program


#include<stdio.h>

#include<math.h>

int main()

{

    int q;

    scanf("%d",&q);

    while(q--)

    {

        long long start,end;

        scanf("%lld %lld",&start,&end);

        long long a = ceil(sqrt(start));

        long long b = floor(sqrt(end));

        if(b >= a)

            printf("%lld\n", b-a+1);

        else

            printf("0\n");

    }

    return 0;

}