Question: Language : C Jojo has just created an account for an MMORPG. There are N missions in the game, each having a boss with a

Language : C

Jojo has just created an account for an MMORPG. There are N missions in the game, each having a boss with a power level of Xi. To complete a mission, Jojo needs to have a power level that is not smaller than the power level of its boss. After finishing a mission, Jojos power level decreases according to the power level of its boss. The missions can be completed in any order. Jojo wants to know the maximum amount of missions he can complete with a power level of Y . Write a program to help Jojo!

Format Input : The input consists of three lines: The first line contains an integer N, the number of missions in the game. The second line contains N integers Xi , the power level of each missions boss. The third line contains an integer Y , Jojos power level.

Format Output : Output a single integer A, the answer to Jojos question.

Constraints : 1 N 100 1 Xi 10^18 1 Y 10^18

Sample Input 1 (standard input): 5 1 2 3 4 5 15 Sample Output 1 (standard output) : 5

Sample Input 2 (standard input): 3 69 69 420 361 Sample Output 2 (standard output): 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!