Race Against Time
Time limit2sMemory limit512 MB
Given students' distances and walking speeds, find the velomobile's pickup plan that gets the last student to school as early as possible, with boarding points.
Statement
The director of the school Лицей Программистов in the city of Linejsk has taught his students good discipline, but many of them still arrive late.
Linejsk has only one main street. The school is on it, and so are the homes of all its students. Disciplined students leave home at the same time. However, each student lives at a different distance from the school and walks or runs at a different but constant speed. Some are very slow, and some are Masha Gaika, the future world champion in the 100 meter dash.
To reduce late arrivals, the school bought one velomobile, and the school guard drives it. Besides the driver, the velomobile can carry one student. It moves at a constant speed .
The velomobile spends the night in the school garage. In the morning, at the exact moment all students leave their homes, it sets out toward them to give a ride to one student. It must take the student all the way to the school gate, because nobody wants to be dropped off in the middle of the road. After the velomobile has brought one student to school faster, it can set out toward the next late student.
The director wants to start classes as early as possible, which requires all students to reach the school. Help him plan the route for the velomobile driver so that the arrival time of the last student at school is as small as possible.
Input
The first line contains two integers and (, ). Each of the next lines contains two integers and (), where is the distance from the school to the home of student and is that student's speed.
Output
In the first line, print the minimum time needed for all students to reach school as a real number. In the second line, print the number of students the velomobile must pick up. Then print lines, each with the number of a student to pick up and the distance from the school at which that student must board the velomobile.