a + b + c is equals to a + b + c is equals to control under addition
Answers
Answered by
36
Answer:
Given four positive integers A, B, C and K. The task is to check if it is possible to equalize the three integers A, B and C with the help of K and make K equal to 0. In one operation, you can subtract any value form K (if it remains greater than equal to 0 after subtraction) and add the new value to any of the three integers A, B or C.
Examples:
Input: A = 6, B = 3, C = 2, K = 7
Output: Yes
Operation 1: Add 3 to B and subtract 3 from K.
A = 6, B = 6, C = 2 and K = 4
Operation 2: Add 4 to C and subtract 4 from K.
A = 6, B = 6, C = 6 and K = 0
Input: A = 10, B = 20, C = 17, K = 15
Output: No
Similar questions