@@ -0,0 +1,715 @@
+import java.util.Scanner;%0A%0Apublic class Main %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A        Scanner sc = new Scanner(System.in);%0A%0A        while (true) %7B%0A%0A            int expense = sc.nextInt();%0A%0A            if (expense == 0) %7B%0A                break;%0A            %7D%0A%0A            int takedMonths = 0;%0A%0A            for (int i = 1; i %3C= 12; i++) %7B%0A%0A                int income = sc.nextInt();%0A                int expenditure = sc.nextInt();%0A%0A                expense -= income - expenditure;%0A%0A                if (expense %3C= 0 && takedMonths == 0) %7B%0A                    takedMonths = i;%0A                %7D%0A%0A            %7D%0A%0A            System.out.println(takedMonths != 0 ? takedMonths : %22NA%22);%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Create : 0206