P2370 yyy2015c01's USB Drive

Background

On a day in 2020, our yyy2015c01 bought a high-end USB drive.

Description

You borrowed this high-end USB drive from yyy2015c01 to copy some important files, but you found some issues: 1. The USB drive's transfer interface is small; it can only transfer files whose size does not exceed $L$. 2. The USB drive's capacity is small; it can hold a total size of at most $S$. However, you have many files to back up, so you can only back up some of them. To decide which files to back up, you assign each file a value $V_i$, and you want the total value of the backed-up files to be at least $p$. Soon you realize this is impossible with the current interface, because yyy2015c01's transfer interface is too small. You have to spend money to buy a larger interface (a larger interface allows transferring larger files, but it costs more). Note: Your files cannot be split (you can only transfer an entire file and store it in the USB drive). The total size of the files you put in the USB drive cannot exceed the drive's capacity. Now the question: When the total value of the files in the USB drive is not less than $p$, what is the minimum required interface size?

Input Format

The first line contains three positive integers $n, p, S$, representing the number of files, the desired minimum total value $p$, and the USB drive capacity $S$. The next $n$ lines each contain two positive integers $W_i, V_i$, representing the size and value of the $i$-th file.

Output Format

Output a single positive integer representing the minimum required interface size. If there is no solution, output `No Solution!`.

Explanation/Hint

Constraints: $1 \le n, W_i, S \le 10^3$, $1 \leq V_i \leq 10^6$, $1 \leq p \leq 10^9$. The testdata is small; please do not overcomplicate. Sample explanation 1: Buy an interface of size $2$, and put items $1$ and $2$ into the $\text{U}$ drive. Sample explanation 2: Buy an interface of size $500$. Sample explanation 3: You could have bought an interface of size $2$, but the USB drive capacity cannot hold enough files. If there is any oversight in the testdata, please contact the problem setter [a710128](https://www.luogu.com.cn/user/2573). Salute to the protagonist of this problem, classmate yyy2015c01! Translated by ChatGPT 5