Question: The problem is from HackEarth, plz answer this question by c++ Problem The current number of points of each team are X1, X2, X3....XN. M
The problem is from HackEarth, plz answer this question by c++
Problem
The current number of points of each team are X1, X2, X3....XN. M days of the league stage are remaining and on each day K teams win and each of the winning team's points is incremented by 1. Top B teams will qualify for the playoffs in the championship. Officials of the tournament want to know how many teams have a non-zero probability of making it to the playoffs.
Note: If points of certain teams are equal, any of the teams can qualify for playoffs and each team has equal probability. Input format
-
The first line contains an integer T denoting the number of test cases. For each test case:
-
The first line contains four space-separated integers N, M, K, and B.
-
The second line contains N space-separated integers X1, X2, X3...XN. Output format Print T integers. For each test case:
Print the number of teams that have a non-zero probability of making it to the playoffs.
Sample Input
2 4 2 2 1 4 1 2 3 4 1 1 1 4 4 4 4 Sample Output
-
3
-
4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
