import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int howManyGames(int p, int d, int m, int s) { // Return the number of games you can buy int a[]=new int[11]; int i=1,count=0; a[0]=p; while(p!=m && p>m) { p=p-d; a[i]=p; i++; } a[i]=m; int p1=a[0]; for(int j=i+1;j<11;j++) { a[j]=m; } int j=0; do { p1=p1+a[j+1]; j++; count++; }while(p1