https://i1.wp.com/eblogarithm.com/wp-content/uploads/2017/08/Codeforces-Round-426-Div-2-problem-C-The-Meaningless-Game-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #426 (Div. 2), problem: (C) The Meaningless Game Solution In C/C++

#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”;
}
}

(Visited 82 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: