Here is my take on the problem.
I came up with 17 for x, applying the same thinking as yuppievn.
To determine y, I started with the smallest subject (history)
30 -19 = 11 (number of student not yet assigned to a class)
assigning these student to English
22-11= 11 (number of student taking both english and history)
Of these 11 student only 6 need to take math --> 25+11-y = 30 -->(solve for y)--> y=6
I think the correct answer is 23