@@ -0,0 +1,1344 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the howManyGames function below.%0A    static int howManyGames(int p, int d, int m, int s) %7B%0A        // Return the number of games you can buy%0A        if(s%3Cp) return 0;%0A        int cost=p;%0A        int count=0;%0A        while(true)%7B%0A            if(s-cost%3E=0) %7B%0A                count++;%0A                s-=cost;%0A                if(cost%3Em && (cost-d%3Em)) cost-=d;%0A                else cost=m;%0A            %7D%0A            if(s%3Ccost) break;%0A        %7D%0A        return count;%0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        String%5B%5D pdms = scanner.nextLine().split(%22 %22);%0A%0A        int p = Integer.parseInt(pdms%5B0%5D);%0A%0A        int d = Integer.parseInt(pdms%5B1%5D);%0A%0A        int m = Integer.parseInt(pdms%5B2%5D);%0A%0A        int s = Integer.parseInt(pdms%5B3%5D);%0A%0A        int answer = howManyGames(p, d, m, s);%0A%0A        bufferedWriter.write(String.valueOf(answer));%0A        bufferedWriter.newLine();%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

add HalloweenSale.java