#P2651. 添加括号III
添加括号III
Description
You are given an expression of the form .
If you evaluate it directly from left to right, for example, .
However, Little A feels uncomfortable seeing a fraction and wants to insert some parentheses to make it an integer. One possible way is .
Given the expression, determine whether it is possible to change the evaluation order by adding parentheses so that the result becomes an integer.
Input Format
There are multiple expressions in one test file.
The first line contains , the number of expressions.
For each expression, the first line contains , and the second line contains numbers. The -th number denotes .
Output Format
Output lines.
For each expression, if it is possible to change the evaluation order by adding parentheses to make the result an integer, output Yes; otherwise, output No.
2
4
1 2 1 4
5
6 5 7 9 12
Yes
No
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , , .
Translated by ChatGPT 5
京公网安备 11011102002149号