let the maximum marks be x
Candidate A score = 20% of x
= 20/100 (x)
=> x/5
The candidate fails by 50 marks
Hence , candidate would have passed if 50 marks are added to his marks :
x/5 +50 => (x+250)/5
Now, score of Candidate B
40% of x
=> 40/100 (x) =>2x/5
A.T.Q
2xs/5 – 30
=> (2x-150)/5
both the equations are equal as both the equations justify minimum passing marks
Hence, (x+250)/5 = (2x-150)/5
cancelling 5 from both sides
x+250 = 2x – 150
x = 400
Hope this helps.