Problem Description

Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey very much, so he decides to get some honeycombs for honey. There are N honeycombs hanging on some trees, numbered from 1 to N, and the height of honeycomb i is Hi. The height Soapbear can reach the is Hx, so he wonders how many honeycombs he can get at most.

Input

There are multiple test cases in the input file. There first line of the input is an integer T indicates the number of the test cases. Each test case starts with a line containing two integer, N and Hx (0 < N <= 200000, 0 < Hx < 200). Next, there is a line of N integers specifying Hi (1 <= i <= N, 0 < Hi < 200).

Output

For each test case, output a line with an integer indicates the number of honeycombs Soapbear can get at most.

Sample Input

2
2 180
170 190
3 180
180 170 190

Sample Output

1
2

HINT

Note:Input/Output of scanf/printf is faster than cin/cout, so if a problem has huge input data, use cin will probably get a Time Limit Exceeded.

 #include<stdio.h>
#define N 200001
int main()
{
int n,m,Hx=;
int a[N];
scanf("%d",&n);
while(n--)
{
int result=;
for(int i=;i<N;i++)
a[i]=;
scanf("%d",&m);
scanf("%d",&Hx);
for(int j=;j<m;j++)
{
scanf("%d",&a[j]);
}
for(int k=;k<m;k++)
{
if(a[k]<=Hx)
result++;
}
printf("%d\n",result);
}
return ;
}

武汉科技大学ACM:1005: Soapbear and Honey的更多相关文章

  1. 武汉科技大学ACM:1006: 我是老大

    Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...

  2. 武汉科技大学ACM:1005: 单位转换

    Problem Description BobLee最近在复习考研,在复习计算 机组成原理的时候,遇到了一个问题.就是在计算机存储里面的单位转换.我们都知道1MB=1024KB,1KB=1024B,1 ...

  3. 武汉科技大学ACM:1005: 华科版C语言程序设计教程(第二版)例题5.8

    Problem Description 老师给小豪出了一道题目:给你两个整数x和n(-10<=x<=10,1<=n<=10),让你求出x^1+x^2+x^3+……+x^n的结果 ...

  4. 武汉科技大学ACM :1005: 一二三

    Problem Description 你弟弟刚刚学会写英语的一(one).二(two)和三(three).他在纸上写了好些一二三,可惜有些字母写错了.已知每个单词最多有一个字母写错了(单词长度肯定不 ...

  5. 武汉科技大学ACM :1005: C语言程序设计教程(第三版)课后习题6.6

    Problem Description 打印出所有"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该本身. 例如:153是一个水仙花数,因为1 ...

  6. 武汉科技大学ACM :1005: A+B for Input-Output Practice (V)

    Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...

  7. 武汉科技大学ACM :1005: 零起点学算法101——手机短号

    Problem Description 大家都知道,手机号是一个11位长的数字串,同时,作为学生,还可以申请加入校园网,如果加入成功,你将另外拥有一个短号.假设所有的短号都是是 6+手机号的后5位,比 ...

  8. 武汉科技大学ACM :1001: A+B for Input-Output Practice (I)

    Problem Description Your task is to Calculate a + b. Too easy?! Of course! I specially designed the ...

  9. 武汉科技大学ACM:1010: 电话号码

    Problem Description LXD打算换个手机号码,但是他去营业厅选号码的时候却把移动的客服小姐烦得不行,因为他太挑三捡四啦.对于一个手机号的后六位数字(前面五位他就无所谓了),LXD有很 ...

随机推荐

  1. tomcat jar包加载顺序

    加载顺序: 1. $java_home/lib 目录下的java核心api 2. $java_home/lib/ext 目录下的java扩展jar包 3. java -classpath/-Djava ...

  2. Cracking the coding interview--Q2.2

    Implement an algorithm to find the kth to last element of a singly linked list. 实现一个算法寻找链表中倒数第K个数.. ...

  3. mysql 主从 配置和同步管理

    首先呢,需要有两个mysql服务器.如果做测试的话可以在同一台机器上装两个mysql服务程序,注意要两个运行程序的端口不能一样.我用的是一个是默认的3306,从服务器用的是3307端口. 在主服务创建 ...

  4. 【HDOJ】1510 White Rectangles

    这个题目很好,变形的题目也很多.简单DP. /* 1510 */ #include <cstdio> #include <cstring> #include <cstdl ...

  5. [Design Pattern] Iterator Pattern 简单案例

    Iterator Pattern,即迭代时模式,按照顺序依次遍历集合内的每一个元素,而不用了解集合的底层实现,属于行为类的设计模式.为了方便理解记忆,我也会称其为遍历模式. 下面是一个迭代器模式的简单 ...

  6. C++ STL之vector常用指令

    只记载本人在ACM中常用的函数. vector,相当于动态数组,数组大小可变.声明vector以后,自动在内存中分配一块连续的内存空间进行数据存储. vector在内部进行插入.删除操作时间复杂度O( ...

  7. 微信/易信公共平台开发(二):自定义菜单的PHP实现(提供源码)

    微信把公众号分成订阅号和服务号两种,服务号可以自定义菜单, 菜单大大方便了用户操作. 比如:公众服务号 "中国南方航空" 的自定义菜单如下图: 点菜单就可以直接进入操作了,方便! ...

  8. 【COM学习】之一、QueryInterface

    开始先说一句,学习com之前要学好c++ 对象模型. QueryInterface的使用: QueryInterface是IUnknown的一个成员函数,客户可以通过此函数来查询某个组件是否支持某个特 ...

  9. NSString去掉火车和空格

    //    backString = [backString stringByReplacingOccurrencesOfString:@"\r" withString:@&quo ...

  10. [RxJS] Creation operator: create()

    We have been using Observable.create() a lot in previous lessons, so let's take a closer look how do ...