First, realize that the total points awarded is 40. Given that we are dealing with integers that means the total number of Events (TE) times the total number of points awarded in an event (TP) must equal 40. We can quickly eliminate some possibilities.
So we now know it was either 4 events with 10 points awarded in an event or 5 events with 8 points awarded. Let's look at the 4/10 situation first. The possible points for each place with 10 overall points available is (all other combinations are impossible because of the `1st gt 2nd gt 3rd gt 0` constraint):
● 5, 3, 2 : Not possible as there is no way to get to 22 points in 4 events (greatest possible points would be 20)
● 5, 4, 1 : Same reason
● 6, 3, 1 : Not possible, since no combination of 4 numbers can get to 22 points `(3 xx 6+3= 21, 4 xx6=24)`
● 7, 2, 1 : A possibility – let's look further. Can we get Gryffindor to 22? Yes. Gryffindor can finish 1st 3 times and 3rd once (in the Quidditch). 3 ×7+1 = 22. Can we get Slytherin to 9? Nope. Slytherin won the Quidditch (7 points). There's no way to get to 9 with the remaining event/point combinations. Sooooo
There must be 5 events with a total of eight points (we're getting close). Let's look at the possible points (again, the other combinations are not possible because of the `1st gt 2nd gt 3rd gt 0` constraint):
● 4, 3, 1 : Not possible as there is no way to get to 22 points (4 ×5=20 is maximum)
● 5, 2, 1 : Looks like this is the winner. Let's check. Can we get Gryffindor to 22? Yes. Gryffindor can finish 1st 4 times and 2nd once (4 ×5+2). Since we know Slytherin finished 1st in the Quidditch, Gryffindor must have finished 2nd. Can we get Slytherin to 9? Yes. Slytherin finished 1st in the Quidditch (5 points) and finished 3rd 4 times (4 ×1) for a total of 9 points. Can we get Ravenclaw to 9? Yes. Ravenclaw finished 3rd in the Quidditch (1 point) and must have finished 2nd in the 4 other events (4 ×2) for a total of 9 points.
Since Ravenclaw finished 2nd in EVERY EVENT OTHER THAN THE QUIDDITCH, he MUST have finished 2nd in the O.W.Ls. Here is a little table:
