Question: The problem is from HackEarth, plz answer this question by c++ Problem In a football championship, N teams are competing against each other on the

The problem is from HackEarth, plz answer this question by c++

Problem

In a football championship, N teams are competing against each other on the league stage. The current number of points of each team are X1, X2, X3....XN. M days of 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 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.

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!