#000503

operacija

Four numbers A, B, [] and op are given. Number op have following meaning:
- op = 1 addition,
- op = 2 substaction,
- op = 3 multiplying,
- op = 4 division.


For given input data write 1 if A op B = C, else write 0.


InputIn first line of standard input are integers A, B, C and op (0 <= A, B, C <= 10,000,000,000, 1 <= op <= 4).

OutputIn first row of standard output write 0 or 1, depending of above constrains.

Note:
In at least 50% tests op will be 1 or 2.
60% tests will have values for A, B i C from [0, 100].
Input:
[c]1 2 3 1

Output:
1
Explanation:
Expression 1 + 2 = 3 is correct, so output is 1.

Input:
2 1 2 4
Output:
1

Input:
3 2 1 4
Output:
0
Explanation:
3 / 2 = 1.5, so 3 / 2 = 1 is not correct.

Input:
4 5 21 3
Output:
0
Explanation:
4 * 5 = 20.

Input:
55 5 50 2
Output:
1

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.