Codeforces Round 277.5 (Div. 2)
E
Hiking
Codeforces
2300
原题
← DF →
翻译中…

A traveler is planning a water hike along the river. He noted the suitable rest points for the night and wrote out their distances from the starting point. Each of these locations is further characterized by its picturesqueness, so for the $*i*$-th rest point the distance from the start equals $*x*_{*i*}$, and its picturesqueness equals $*b*_{*i*}$. The traveler will move down the river in one direction, we can assume that he will start from point $0$ on the coordinate axis and rest points are points with coordinates $*x*_{*i*}$.

翻译中…

Every day the traveler wants to cover the distance $*l*$. In practice, it turns out that this is not always possible, because he needs to end each day at one of the resting points. In addition, the traveler is choosing between two desires: cover distance $*l*$ every day and visit the most picturesque places.

翻译中…

Let's assume that if the traveler covers distance $*r*_{*j*}$ in a day, then he feels frustration image, and his total frustration over the hike is calculated as the total frustration on all days.

翻译中…

Help him plan the route so as to minimize the relative total frustration: the total frustration divided by the total picturesqueness of all the rest points he used.

翻译中…

The traveler's path must end in the farthest rest point.

翻译中…

Input

翻译中…

The first line of the input contains integers $*n*, *l*$ ($1 ≤ *n* ≤ 1000, 1 ≤ *l* ≤ 10^{5}$) — the number of rest points and the optimal length of one day path.

翻译中…

Then $*n*$ lines follow, each line describes one rest point as a pair of integers $*x*_{*i*}, *b*_{*i*}$ ($1 ≤ *x*_{*i*}, *b*_{*i*} ≤ 10^{6}$). No two rest points have the same $*x*_{*i*}$, the lines are given in the order of strictly increasing $*x*_{*i*}$.

翻译中…

Output

翻译中…

Print the traveler's path as a sequence of the numbers of the resting points he used in the order he used them. Number the points from 1 to $*n*$ in the order of increasing $*x*_{*i*}$. The last printed number must be equal to $*n*$.

翻译中…

Note

翻译中…

In the sample test the minimum value of relative total frustration approximately equals 0.097549. This value can be calculated as image.

翻译中…

样例

Input #1
5 9
10 10
20 10
30 1
31 5
40 10
Output #1
1 2 4 5
InputCopy OutputCopy
题目信息
题号
489E
时间限制
1 s
内存限制
256 MB
标签
二分
动态规划

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。