Back
Close

Savoli jumhuriyavii junior

Statement
Firdavsi's brother Ibrohim gave him m somoni (money) he said to him bought banana Market has n bananas which are a[i] somoni help him to buy maximum banana

Input description
Given m ,n and array which is from 1 to n

Output description
maximum banana which can buy Firdavsi

Constraints
1<=n<=10 1<=m , a <=100

Game modes

Test cases
Test 1 Test
Input
40 5 10 20 15 10 10
Output
3

Validator 1 Validator
Input
40 5 10 20 15 10 10
Output
3

Test 2 Test
Input
15 5 1 2 3 4 5
Output
5

Validator 2 Validator
Input
15 5 1 2 3 4 5
Output
5

Test 3 Test
Input
4 5 5 5 5 5 5
Output
0

Validator 3 Validator
Input
4 5 5 5 5 5 5
Output
0

Test 4 Test
Input
20 5 10 10 1 2 3
Output
4

Validator 4 Validator
Input
20 5 10 10 1 2 3
Output
4

Solution language

Solution

Stub generator input
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants