#!bin/python3 import sys def howManyGames(p,d,m,s): l=[] count=0 while(p>m): if(sum(l)<=s): l.append(p) p=p-d if(p==m): break while(sum(l)<=s): l.append(m) for j in l: count=count+1 return(count-1)