TORONTO KIDS COMPUTER CLUB | Aurora Saturday 14:30 Python Practice 22.06.25.
post-template-default,single,single-post,postid-20819,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Aurora Saturday 14:30 Python Practice 22.06.25.

11 Jul Aurora Saturday 14:30 Python Practice 22.06.25.


You are planning to watch many TV shows during the summer. Assuming you already know the broadcast schedule of all the TV shows you like to watch, your goal is to watch as many complete programs as possible.

The input data contains multiple test instances. The first line of each test instance has only one integer n (n<=100), which represents the total number of programs you like to watch, and then n rows of data. Each row includes two data Ti_s, Ti_e (1<=i<=n), respectively represent the start and end time of the i-th program. In order to simplify the problem, each time is represented by a positive integer. n=0 means the input is over and no processing is done.

For each test instance, output the number of TV programs that can be viewed completely, and the output of each test instance occupies one line.

Sample Input
12 1 3 3 4 0 7 3 8 15 19 15 20 10 15 8 18 6 12 5 10 4 14 2 9 0

Sample Output

No Comments

Sorry, the comment form is closed at this time.