#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <sstream>
#include <cmath>
using namespace std;
bool failed;
int _solve()
{
int w1, d1, w2, d2;
scanf("%d%d%d%d", &w1, &d1, &w2, &d2);
if (!w1)
w1 = _solve();
if (!w2)
w2 = _solve();
if (w1 * d1 != w2 * d2)
failed = true;
return w1 + w2;
}
int main()
{
int T;
scanf("%d", &T);
while (T-- > 0)
{
failed = false;
_solve();
printf("%s\n", (failed) ? "NO" : "YES");
if (T)
putchar('\n');
}
return 0;
}
ACM篇:UVa 839 -- Not so Mobile
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.