Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
long long int a,b,g;
cin >> n;
while (n–)
{
cin >> a >> b;
g = round(pow(a * b, 1.0 / 3));
if (a % g == 0 && b % g == 0 && a * b == g * g * g) cout << “Yes\n”;
else cout << “No\n”;
}
}
📦 Looking for Codeforces Round 426 Div Problem Meaningless? Check the best deals on Amazon.
🛒 Shop Codeforces Round 426 Div Problem Meaningless on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.
Affiliate Disclosure: This post contains Amazon affiliate links. If you purchase through these links, eBlogarithm may earn a commission at no extra cost to you. Prices and availability are subject to change.
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n;
long long int a,b,g;
cin >> n;
while (n–)
{
cin >> a >> b;
g = round(pow(a * b, 1.0 / 3));
if (a % g == 0 && b % g == 0 && a * b == g * g * g) cout << “Yes\n”;
else cout << “No\n”;
}
}
📦 Looking for Codeforces Round 426 Div Problem Meaningless? Check the best deals on Amazon.
🛒 Shop Codeforces Round 426 Div Problem Meaningless on Amazon
As an Amazon Associate, eBlogarithm earns from qualifying purchases. Prices and availability are subject to change.