I think you have to consider the defeated matches for the second equation, even though it does not affect the final result.
I set this up in two equations:
1) 3W + D = 31
To minimize the number of wins, then we need to maximize the number of points via draw. Total points add up to the remaining 31 points to make it to 40 incremental to the 9 obtained after 5 games.
2) W + D = 15
Total number of wins + draws should add up to the 15 games to make 20 games on top of the 5 games already played
W = 8
D = 7
Minimum wins is 8 => c)