to count the number of square integers between AA and BB (both inclusive) output shows run time error when both are 9 digits : 

    #include<cmath>
    #include<cstdio>
    #include<vector>
    #include<iostream>
    #include<algorithm>
    using namespace std;

    int main() {
    int t;long long a, b;long long x; //declartion
    cin>>t;                    //1≤T≤1001≤T≤100  
    if(t<1||t>100)
        exit(0);
    for(int i=0;i<t;i++){
       long long c=0;
    cin>>a>>b;
    if(a>b||a<1||a>pow(10,9)||b<1)         //1≤A≤B≤109
        exit(0);
    for(long long y=a;y<=b;y++){
        x= floor(sqrt(y));
        if(pow(x,2)==y){
            c++;
        }
       }cout<<c<<endl;
    }
       
    return 0;`
     }
Watson gives two integers (AA and BB) to Sherlock and asks if he can count the number of square integers between AA and BB (both inclusive).
this is my code please tell me why iam getting error time?