fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6. int n;
  7. ll a,b,x;
  8. cin>>n;
  9. for(int i=0;i<n;i++)
  10. {
  11. cin>>a>>b;
  12. x=(ll)(a*b);
  13. ll crt=(ll)cbrt(x);
  14. if(crt*crt*crt==x)
  15. cout<<"Yes"<<endl;
  16. else
  17. cout<<"No"<<endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty