{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eDawn-K recently discovered a very magical phenomenon in the supermarket of Northeastern University: The large package is not necessarily more expensive than the small package.\u003c/p\u003e\n\u003cp\u003eOn this day, Dawn-K came to the supermarket to buy mineral water, he found that \u003cstrong\u003ethere are $n$ types of mineral water\u003c/strong\u003e, and he already knew \u003cstrong\u003ethe price $p$\u003c/strong\u003e and \u003cstrong\u003ethe weight $c$ (kg)\u003c/strong\u003e of each type of mineral water. Now Dawn-K wants to know \u003cstrong\u003ethe least money $a$\u003c/strong\u003e he needs to buy \u003cstrong\u003eno less than $m$ kilograms\u003c/strong\u003e of mineral water and \u003cstrong\u003ethe actual weight $b$ of mineral water he will get\u003c/strong\u003e. Please help him to calculate them.\u003c/p\u003e\n\u003ch2\u003eInput\u003c/h2\u003e\n\u003cp\u003eThe input consists of multiple test cases, each test case starts with a number $n$ ($1 \\le n \\le 10^3$) -- the number of types, and $m$ ($1 \\le m \\le 10^4$) -- the least kilograms of water he needs to buy.\u0026nbsp;For each set of test cases, the sum of $n$ does not exceed $5e4$.\u003c/p\u003e\n\u003cp\u003eThen followed n lines with each line two integers $p$ ($1 \\le p \\le 10^9$) -- the price of this type, and $c$ ($1 \\le c \\le 10^4$) -- the weight of water this type contains.\u003c/p\u003e\n\u003ch2\u003eOutput\u003c/h2\u003e\n\u003cp\u003eFor each test case, you should output one line contains the minimum cost $a$ and the weight of water Dawn-K will get $b$. If this minimum cost corresponds different solution, output the maximum weight he can get.\u003c/p\u003e\n\u003cp\u003e(The answer $a$ is between $1$ and $10^9$, and the answer $b$ is between $1$ and $10^4$)\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 3\n2 1\n3 1\n1 1\n3 5\n2 3\n1 2\n3 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3 3\n3 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}