Amin records the price of his stock every now and then as a data point in his notebook, where is the price of his stock at day . The sequence of these data points represents a piecewise-linear function displaying the history of prices over a period of time. Indeed, connects every pair of consecutive points by a straight line segment. If the price is not recorded for some day , can be used as an estimate instead. His collected data is getting larger and larger as he has been tracking the price of his stock over a long period of time. Therefore, he has decided to reduce his data by throwing away some of his recoded data points and constructing a new piecewise-linear function ′ with the remaining points. ′ is a so-called “simplification” of . Amin wants to create the simplification in such a way that ′ is a good approximation for . To this end, he has defined an error measure as follows.
Let be defined over a strictly increasing sequence of days, and be defined over a subsequence of , where , , and for . (We call the size of .) The error of is defined as the maximum of for all .
For example, in the following figure, we have data points, labeled through , whose coordinates are the same as those presented in the second sample input, and is a simplification of of size with data points , , and . In this figure, is depicted by solid lines, and by dashed lines. The error measure for is realized by the vertical distance of point to .
Amin’s goal is to minimize the size of , while the error of is bounded by a given value .
The first line of input contains a positive integer () that shows the size of . Each of the next lines contains two integers , (), where is the price of the stock at day . The last line contains the error limit which is a non-negative integer at most .
In the output, print the minimum possible size of .