Sanggeun and Jeongin want to buy 1,000 grams of triangular gimbap as cheaply as possible from several convenience stores.
Each store displays its price in the form "X won for Y grams". The first line gives the price at the reference store, followed by the prices at N other stores.
They may buy all 1,000 grams from one store or split the purchase across multiple stores. They cannot buy from any store other than the reference store and the N listed stores.
Compute the minimum amount of money needed to buy 1,000 grams.
The first line contains X and Y, the price information for the reference store. This means X won for Y grams. (1 ≤ X ≤ 100, 1 ≤ Y ≤ 1,000)
The second line contains N, the number of other convenience stores. (1 ≤ N ≤ 100)
Each of the next N lines contains Xi and Yi, the price information for the i-th store. This means Xi won for Yi grams. (1 ≤ Xi ≤ 100, 1 ≤ Yi ≤ 1,000)
Print the minimum cost of buying 1,000 grams of triangular gimbap. An absolute or relative error up to 0.01 is accepted.