Ethan is the leader of a team with
N
members. He has assigned an error score to each member in his team based on the bugs that he has found in that particular team member's task. Because the error score has increased to a significantly large value, he wants to give all the team members a chance to improve their error scores, thereby improving their reputation in the organization. He introduces a new rule that whenever a team member completes a project successfully, the error score of that member decreases by a count
P
and the error score of all the other team members whose score is greater than zero decreases by a count
Q
. Write an algorithm to help Ethan find the minimum number of projects that the team must complete in order to make the error score of all the team members zero. Input The first line of the input consists of an integer-errorscore-size, representing the total number of team members (N). The second line consists of
N
space-separated integers- errorScore, representing the initial error scores of the team members. The third line consists of an integer-compP, representing the count by which the error score of the team member who completes a project successfully decreases
(P)
. The last line consists of an integer-othQ, representing the count by which the error score of the team member whose error score is greater than zero decreases (Q); Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print
0.
team member whose error score is greater than zero decreases
(O)
. Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print 0 Constraints
1≤
errorscorie sime
−2+4
1≤
oth
Q≤
comor
−109
0 errorscoresio9 Note The erfor score of inn theantariember can never be less than zero. Jutput:
3=
Explanation: Firstly, the first team member completes a project successfully the whir ated arriar score of the team members will be:
230.
Then, when a second member completes a project successfilly the updated elroi scare ofllate team members will be: 100 . Then, when the first member completes another project. successfully, the updated soulie the the team members will be: 000