@@ -0,0 +1,669 @@
+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 objective = sc.nextInt();%0A%0A            if (objective == 0) %7B%0A                break;%0A            %7D%0A%0A            int numStudy = sc.nextInt();%0A            int studyTime = 0;%0A%0A            for (int i = 0; i %3C numStudy; i++) %7B%0A%0A                int startTime = sc.nextInt();%0A                int endTime = sc.nextInt();%0A%0A                studyTime += endTime - startTime;%0A%0A            %7D%0A%0A            System.out.println(objective %3C= studyTime ? %22OK%22 : (objective - studyTime));%0A%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Create : 0238