All submissions for this problem are available.
After the huge success of Mangalyaan this year, the ISRO (Indian Space Research Organization) is planning to launch a manned mission to Mars named Mangalyaan-2, in 2015. They obviously would want to select the best astronauts for this space mission. ISRO's research team has examined N available astronauts and computed a fitness score for each of them. It has been decided that astronauts with fitness score greater than or equal to a threshold score P, are eligible for the mission.
Can you report the number of eligible astronauts?
The first line contains an integer T denoting the number of test cases.
Then for each test case, the first line contains two space separated integers N and P denoting number of astronauts and the threshold score respectively.
The second line of each test case contains N space-separated integers A1, A2, ..., AN denoting the fitness scores of the astronauts.
Note: All fitness scores are distinct and are given in descending order.
For each test case, output the number of astronauts eligible for the mission on a separate line.
- 1 ≤ T ≤ 100
- 1 ≤ N ≤ 100
- 1 ≤ P ≤ 1000
- 1 ≤ Ai ≤ 1000
Input: 3 3 10 7 3 1 3 5 7 3 1 3 1 7 3 1 Output: 0 1 3
In the first case, no astronauts are selected as none of them have fitness score greater than or equal to 10.
In the second case, the astronaut with score 7 is selected.
In the third case, all astronauts are selected.
|Tags||acm-icpc, acmamr14, admin|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.