# Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Limits
1s, 512 MB

This year, KUET is hosting the TriCoder tournament. Two other universities have joined this tournament and brought their best programmers . One programmer will be selected as champion from each of the universities and three of them have to compete against each other in three tasks. Each task consists of a number of programming problems. Judges will decide the winner based on result. Now Rifat somehow becomes the fourth champion of the competition. (And oddly enough judges let him compete).

Rifat is a very good programmer. So he managed to pass first two task easily. Now he has to face the third task. This time if he fails to solve any of the problems the computer will chase him with a big machete. (চাপাতি) (I dont know how that’s possible). Rifat is sure he can solve all the problems . But he is also a cautious man. So he wants some kind of magical protection. After all he doesn’t like machete.

He went to the departmental store of KUET. The store has **N** magical items. Their prices are denoted by array **A**. ( **i ^{th}** item cost

Input starts with two integers **N** and **X (1 <= N <= 10 ^{6}, 1 <= X <= 10^{9})** , where

Print one integer denoting maximum number of items Rifat can buy.

Input | Output |
---|---|

5 6 1 2 1 4 6 3 3 3 3 1 | 3 |

Input | Output |
---|---|

6 10 3 4 4 5 5 6 1 2 3 4 5 5 | 2 |

For the first input Rifat can buy **1 ^{st}**,

For second sample case You can select **2 ^{nd}** and

89% Solution Ratio

fsshakkhorEarliest,

rohijulislamFastest, 0.0s

rohijulislamLightest, 918 kB

serotoninShortest, 754B

Login to submit