A man arrives at a bus stop at 12:00.
He remains there during 12:00-12:59.
The bus stop is used by a number of bus routes.
The man notes the times of arriving buses.
The times when buses arrive are given.
Find the schedule with the fewest number of bus routes that must stop
at the bus stop to satisfy the input data.
For each bus route, output the starting time and the interval.
There are several test cases, first line of input contains a number k, indicate how many test cases are there. Each test case contains a number n (n<=300) telling how many arriving buses have been noted, followed by the arrival times in ascending order.
For each test case, write the number of bus route needed.
2 17 0 3 5 13 13 15 21 26 27 29 37 39 39 45 51 52 53 17 0 3 5 13 13 15 21 26 27 29 37 39 39 45 51 52 53
3 3
Migrated from old NTUJ.
No. | Testdata Range | Score |
---|