#include #include #include #include #include #include #include int howManyGames(int p, int d, int m, int s) { // Return the number of games you can buy int i,j,count=0,total=0,cost; cost=p; printf("%d ",cost); total+=cost; printf("%d\n", total); count++; while(total<=s) { if(((cost-d)(total+m))) { cost=m; printf("%d ",cost); total+=cost; printf("%d\n", total); count++; } if(cost>m) { cost=cost-d; printf("%d ",cost); total+=cost; printf("%d\n", total); count++; } else if(cost