- 1000ms
- 65536K
Bob is a sorcerer. He lives in a cuboid room which has a length of A, a width of B and a height of C, so we represent it as A * B * C. One day, he finds that his room is filled with unknown dark energy. Bob wants to neutralize all the dark energy in his room with his light magic. He can summon a 1 * 1 * 2 cuboid at a time to neutralize dark energy. But the cuboid must be totally in dark energy to take effect. Can you foresee whether Bob can save his room or not?
Input
Input has T test cases.T≤100
For each line, there are three integers A,B,C.
1≤A,B,C≤100
Output
For each test case, if Bob can save his room, print"Yes"
, otherwise print"No"
.
样例输入
1 1 2
1 1 4
1 1 1
样例输出复制
Yes
Yes
No
题目来源
问题描述
给你一个A*B*C的立方体,问能不能用1*1*2的小立方体填满
扫描二维码关注公众号,回复:
3404389 查看本文章
思路
只要大立方题的体积A*B*C是小立方体体积2的倍数就可填满
AC的C++代码
#include<iostream>
using namespace std;
int main()
{
int a,b,c;
while(~scanf("%d%d%d",&a,&b,&c)){
if((a*b*c)%2==0)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}