/ OPS / 题库 /

Teacher's assignment

Teacher's assignment

#描述#
Soy's teachers always challenge him with hard problems. But Soy is so lazy that he is scared of dealing with hard problems. Now his teacher assigned him a new task, calculating 24. Given 4 integers a,b,c,d, he is asked whether can the numbers formed a expression equal to 24. He can only use "+","-","*","/","(",")" to make the expression. Changing the order of the numbers is also allowed. Knowing that you are good at programming ,now he is hoping for your help.

#格式#
##输入格式##
There are multiple cases. The first line contains an integer T indicating the number of test cases.
The next T lines, each line contains four numbers a,b,c,d. (1&lt= a,b,c,d &lt= 1000);

##输出格式##
If Soy can get a solution, print "Yes" without quotation. Otherwise print "No" without quotation.

#样例1#
##样例输入1##

4
1 5 5 5
2 3 1 4
1 1 1 1
120 5 2 1

##样例输出1##

Yes
Yes
No
Yes

#限制#
1000ms
32768KB

#提示#
One solution for the first case: (5-(1/5))*5 == 24

#来源#
ziki

信息

ID
1914
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者