Your job is to find the given number
You will be given a string in the following form:
dN ± Y = X
d, N, X, Y are all numbers with d , X , Y being integers (not decimals).
Solve the equation and output the value of
N rounded. Round up if decimal is greater than or equal to
0.5 and round down if less than
Input Output N + 1 = 3 ---> 2 N - 1 = 5 ---> 6 2N + 1 = 3 ---> 1 2N + 1 = 4 ---> 2
Winning criteria :
This is code-golf so the shortest code in each language wins.
- Answer must be rounded it cannot be a float
- Whitespace do not matter. You can have every element in the string separated by white space if you want or if you don't want leave it as it is.
- You do not need to check for invalid input. i.e. All inputs will be strings in the given format.