Problem Description
You are given balloons inside a hall. The ceiling of the hall is at a height of meters. Each balloon initially floats at height meters and rises upward at a constant rate of meters per second. A balloon bursts the moment it reaches or exceeds the ceiling height . You are also given a duration in seconds. Your task is to determine:
- How many balloons do not burst after seconds?
- Among the balloons that do not burst, print the index of the one that is at the maximum height. If multiple balloons have the same maximum height, choose the one with the largest index. If no balloons remain unburst, print
0 -1.
Input Format
The first line contains three integers , , and --- the number of balloons, the height of the ceiling, and the time in seconds. Each of the next lines contains two integers and --- the initial height and the upward velocity of the -th balloon.
Constraints:
Output Format
Print a single line containing two space-separated integers: the number of balloons that do not burst after seconds, and the index of the highest unburst balloon (or if there are none).
Scoring
| Subtask | Additional Constraints | Points | Required Subtask |
|---|---|---|---|
| Tests from the example | - | ||
| and |
Examples
4 10 2 2 3 3 2 5 3 4 1
3 1
2 4 2 0 2 2 1
0 -1
2 5 2 0 2 2 1
2 2