QOJ.ac

QOJ

Time Limit: 5 s Memory Limit: 256 MB Total points: 100

#6571. Business

Statistics

Entrepreneur Bajtazar is the owner of a newly established manufacturing company, Bajtex. He now plans to guide the development of Bajtex so that the company becomes highly profitable in the shortest possible time, earning him the title of "business shark." We say a company is highly profitable if it has an annual income of at least $D$ million bajtalars.

Unfortunately, at this moment, Bajtazar only has a production hall and a capital of $p$ million bajtalars. This money can be used to purchase production machines. Additionally, once Bajtex starts generating profits, the earned money can be used to purchase further machines.

There are $n$ types of machines available on the market. A machine of the $i$-th type costs $c_i$ million bajtalars and provides an additional income of $d_i$ million bajtalars per year. There is nothing preventing the purchase of multiple machines of the same type.

Help Bajtazar determine the shortest time in which he can become a business shark. We assume that the purchase of a machine (including delivery and installation) takes negligible time and causes an immediate increase in the company's income. Furthermore, we assume that the company earns money continuously, i.e., for any set of machines guaranteeing an income of $x$ million bajtalars per year and for any real $t \ge 0$, these machines will earn exactly $t \cdot x$ million bajtalars over $t$ years.

Input

The first line of input contains three integers $n$, $D$, and $p$ ($1 \le n \le 100$, $1 \le D \le 100\,000$, $1 \le p \le 10^9$), representing the number of machine types, the required annual income level (in million bajtalars), and Bajtazar's initial capital (in million bajtalars), respectively.

The next $n$ lines contain the description of the available machine types. The $i$-th of these lines contains two integers $c_i$ and $d_i$ ($1 \le c_i \le 10^9$, $1 \le d_i \le D$), representing the cost of a machine of the $i$-th type and the annual income it provides, respectively.

It can be assumed that Bajtazar's capital allows for the purchase of at least one machine.

Output

Output a single real number representing the minimum time (in years) required for Bajtex to become highly profitable and for Bajtazar to receive the title of business shark. The result will be considered correct if the relative or absolute error is no greater than $10^{-6}$.

Examples

Input 1

3 14 6
2 2
5 6
6 7

Output 1

0.783333333

Note 1

In the first case, it is optimal to buy a machine of the second type at the beginning of the company's operation. Then, Bajtazar buys a machine of the first type every time he has sufficient funds until he becomes a business shark (which requires four such machines). He can buy the next machine of the first type after $\frac{2}{6}$, $\frac{2}{8}$, $\frac{2}{10}$, and $\frac{2}{12}$ of a year from the purchase of the previous one, respectively.

Input 2

1 1 1
1 1

Output 2

0.000000000

Note 2

In the second case, Bajtazar has sufficient capital to become a business shark at the very beginning of the company's operation.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.