@@ -0,0 +1,1209 @@
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0Apublic class HamsterFarm %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));%0A        System.out.println(run(reader));%0A    %7D%0A%0A    private static String run(BufferedReader reader) throws IOException %7B%0A        String%5B%5D firstLine = reader.readLine().split(%22 %22);%0A        long amountOfHamsters = Long.parseLong(firstLine%5B0%5D);%0A        int amountOfBoxesTypes = Integer.parseInt(firstLine%5B1%5D);%0A        String%5B%5D amountOfBoxesByTypes = reader.readLine().split(%22 %22);%0A        long minRest = Long.MAX_VALUE;%0A        int minRestIdx = 0;%0A        for (int i = 0; i %3C amountOfBoxesTypes; i++) %7B%0A            long amountOfBoxes = Long.parseLong(amountOfBoxesByTypes%5Bi%5D);%0A            long restHamsters = amountOfHamsters %25 amountOfBoxes;%0A            if (restHamsters %3C minRest) %7B%0A                minRestIdx = i;%0A                minRest = restHamsters;%0A            %7D%0A        %7D%0A        long numberOfBoxes = amountOfHamsters / Long.parseLong(amountOfBoxesByTypes%5BminRestIdx%5D);%0A        return (minRestIdx + 1) + %22 %22 + numberOfBoxes;%0A    %7D%0A%7D%0A

Add HamsterFarm