#K83422. Maximum Plants Watered Each Day
Maximum Plants Watered Each Day
Maximum Plants Watered Each Day
You are given the watering schedule for various plants. Each plant's schedule consists of a plant name followed by a list of dates (given in ascending order) when it requires watering. Your task is to merge all these schedules and, for each distinct day, output the number of different types of plants that need watering.
Formally, the input begins with an integer \( T \) denoting the number of plant schedules. Each of the following \( T \) lines contains a plant name and one or more integers representing the dates \( d_1, d_2, \ldots, d_k \) (where \( d_1 < d_2 < \cdots < d_k \)). For each unique date that appears in any schedule, output the day and the total count of plants that require watering on that day. The output must be in ascending order of dates.
inputFormat
The first line contains an integer \( T \) (\( 1 \le T \le 10^5 \)), the number of plant schedules. Each of the next \( T \) lines contains a plant name (a non-space string) followed by one or more integers indicating the dates when this plant needs watering. The dates for each plant are provided in strictly increasing order.
outputFormat
For each distinct date present in the input, output a line with two integers: the date and the count of plants to be watered on that day. The output must be sorted in ascending order of dates.
## sample3
roses 1 5 10
tulips 5 15 25
daisies 1 10 20
1 2
5 2
10 2
15 1
20 1
25 1
</p>