In GBN,
First time 4,3,2,1 will be transmitted and received successfully.
Second time 8,7,6,5* will be transmitted and 5 will lost. so this along with the rest packets will be transmitted again.
Third Time 8,7,6*,5 will be transmitted and 6 will lost this time as it is the next fifth. So this along with the rest packets will be transmitted again.
Fourth time 9,8*,7,6 will be transmitted and 8 will lost as it is next fifth. so this along with the rest packets will be transmitted again.
Lastly 10,9,8 will be transmitted and reached successfully.
Therefore total 19 Transmissions in GBN.
In SR,
First time 4,3,2,1 will be transmitted and received successfully.
Second time 8,7,6,5* will be transmitted and 5 will lost and rest will reach. Third time 10,9* 5 will be transmitted and 9 will lost.
Lastly 9 will be transmitted and reaches successfully.
Therefore total 12 Transmissions in SR.
Then x+y = 31.