Halloween Sale

  • + 0 comments

    public static int howManyGames(int p, int d, int m, int s) { int sum = 0; int c = 0;

         while (sum + p <= s) {
             sum += p;
             p = Math.max(p - d, m);
             c++;
        }
    return c; 
    }
    

    }