Ok, first reduce the space by 400 for the questions that follow, since effectively only 600 students are left of interest to us (1000-400=600).
a) Well of those 600, we know 200 passed the M-exam (600-400=200), and 250 passed the S-exam(650-400=250).Since none of these students passed both exams, we've already subtracted those, this means 600-(200+250) = 150 failed both exams.
b) Well this one is simple now, because
1000 = 400(passed both exams) + 150(passed neither exam) + x(passed one of the two exams). Solving for x, x=450.