Goose Coins

아직 제출이 없습니다시간 제한3초메모리 제한1024 MB

문제

The Goose Kingdom uses nn types of goose coins as their national currency. The ii-th type of goose coin has a value of c_ic\_i goose-dollars and a weight of w_iw\_i. For all i (1in1)i\ (1 \le i \le n-1), c_i+1c\_{i+1} is a multiple of c_ic\_i and c_i<c_i+1c\_i < c\_{i+1}.

You visited Goose Market and bought pp goose-dollars worth of goods. You want to pay the exact price using exactly kk goose coins. You have infinitely many coins of each type, so you don't have to worry about running out of coins. 

Write a program to find the minimum and maximum possible total weights of kk coins with total value of pp goose-dollars. If there is no such set of coins, output 1-1.

입력

The first line contains three integers nn, kk, and p (1n60,1k103,1p1018)p\ (1\le n \le 60, 1\le k \le 10^3, 1\le p \le 10^{18}). nn is the number of types of goose coins. kk is the number of coins you have to use to make exactly pp goose-dollars.

In the following nn lines, the ii-th line contains two integers c_i (1c_i1018)c\_i\ (1 \le c\_i \le 10^{18}) and w_i (1w_i1015)w\_i\ (1\le w\_i \le 10^{15}), representing the value and the weight of the ii-th type of goose coin. 

For all i (1in1)i\ (1 \le i \le n-1), c_i+1c\_{i+1} is a multiple of c_ic\_i and c_i<c_i+1c\_i < c\_{i+1}.

출력

If it is possible to pay exactly pp goose-dollars using exactly kk goose coins, output the minimum and maximum possible total weights of the kk coins. Otherwise, output 1-1.