Evaluate the x + a = b statement
Basic Accuracy: 22.94% Submissions: 1610 Points: 1

Given a string of form x + a = b where a and b are integer, find value of x [Note that spaces may or may not be there, for example, input can either be x+a=b or x + a = b or x+a = b].

For example if input string is x + 12 = 3 then output should be -9

 

Constraints:
1 <=T<= 30
1 <=a,b<= 1000

Example:
Input:

2
x+5=2
x+10=20

Output:
-3
10

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.