Help me in solving EXISTENCE problem

My issue

i implemented the same logic as the hint & solution, but still getting wrong answer.

My code

#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
int t; cin>>t;
while(t--)
{
    double x,y;
    cin>>x>>y;
    if(x*x - 2*y == 0) cout<<"YES\n";
    else cout<<"No\n";
}
}

Learning course: Number theory
Problem Link: Existence Practice Problem in Introduction to Number theory - CodeChef

include <bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
while(t–)
{
long long x,y;
cin>>x>>y;
if(xx==2y)
cout<<“YES”<<endl;
else
cout<<“NO”<<endl;
}
return 0;
}

//In this problem the last case contains more bits. So use (long long) data types for storing large bits values.