#P10839. 【MX-J2-T0】Turtle and Equations
【MX-J2-T0】Turtle and Equations
Background
Original problem link: https://oier.team/problems/J2A.
Problem Description
You are given four positive integers .
Now you have an expression . You need to determine whether it is possible to fill each of the two boxes with one of the three operators (operators may be reused) so that the value of the expression equals .
Input Format
The first line contains four positive integers .
Output Format
If it is possible to make the result equal to , output Yes; otherwise output No.
1 1 1 3
Yes
5 2 9 27
Yes
1 1 4 514
No
Hint
Sample Explanation #1
Because , you can put in the first box and in the second box.
Sample Explanation #2
Because , you can put in the first box and in the second box.
Sample Explanation #3
No matter which operators you choose, you cannot make the result of the expression equal to .
Constraints
For all testdata, and .
Translated by ChatGPT 5