What are 2 taste case are getting fail

#include
using namespace std;
int main() {
unsigned int long long A;
cin>>A;

unsigned int long long n=A*A;
int i=1;
unsigned int long long a=i;
unsigned int long long b=A;
bool flag=0;

if(A==0)
{
    cout<<"-1"<<endl;
}
else
{
    while(b<=n)
    {
        if( (b*b)-(a*a)==n)
        {
            cout<<a<<" "<<b<<endl;
            flag=1;
            
        }
        if((b*b)-(a*a)>=n)
        {
            a++;
        }
        else
        {
            b++;
            a=i;
        }
    }
    if(flag==0)
    {
        cout<<"-1"<<endl;
    }
}
return 0;

}

Hey @shdanish1508 Please run your code on https://ide.codingblocks.com/ and share the link here.

Hey @shdanish1508 please change it to if(A<3) cout<<"-1";
and once the flag is equal to 1 you need to break from the loop.
Also for the two cases in which your getting TLE , you need to change your approach so that you can answer in O(1) time and not run a loop. Try to make a formula to generate your answer.