@@ -0,0 +1,713 @@
+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 n = sc.nextInt();%0A%0A            if (n == 0) %7B%0A                break;%0A            %7D%0A%0A            int tryingCount = 1;%0A            boolean canGetSameItem = false;%0A%0A            for (int i = 0; i %3C n; i++) %7B%0A%0A                int item = sc.nextInt();%0A%0A                if (1 %3C= item) %7B%0A                    tryingCount++;%0A                %7D%0A%0A                if (2 %3C= item) %7B%0A                    canGetSameItem = true;%0A                %7D%0A%0A            %7D%0A%0A            System.out.println(canGetSameItem ? tryingCount : %22NA%22);%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Create : 0279