CF913D Too Easy Problems

Description

You are preparing for an exam on scheduling theory. The exam will last for exactly $ T $ milliseconds and will consist of $ n $ problems. You can either solve problem $ i $ in exactly $ t_{i} $ milliseconds or ignore it and spend no time. You don't need time to rest after solving a problem, either. Unfortunately, your teacher considers some of the problems too easy for you. Thus, he assigned an integer $ a_{i} $ to every problem $ i $ meaning that the problem $ i $ can bring you a point to the final score only in case you have solved no more than $ a_{i} $ problems overall (including problem $ i $ ). Formally, suppose you solve problems $ p_{1},p_{2},...,p_{k} $ during the exam. Then, your final score $ s $ will be equal to the number of values of $ j $ between 1 and $ k $ such that $ k

Input Format

The first line contains two integers $ n $ and $ T $ ( $ 1

Output Format

In the first line, output a single integer $ s $ — your maximum possible final score. In the second line, output a single integer $ k $ ( $ 0

Explanation/Hint

In the first example, you should solve problems 3, 1, and 4. In this case you'll spend $ 80+100+90=270 $ milliseconds, falling within the length of the exam, 300 milliseconds (and even leaving yourself 30 milliseconds to have a rest). Problems 3 and 1 will bring you a point each, while problem 4 won't. You'll score two points. In the second example, the length of the exam is catastrophically not enough to solve even a single problem. In the third example, you have just enough time to solve both problems in $ 42+58=100 $ milliseconds and hand your solutions to the teacher with a smile.