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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started