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. 关于RESTful

    http://www.ruanyifeng.com/blog/2011/09/restful.html (1)每一个URI代表一种资源: (2)客户端和服务器之间,传递这种资源的某种表现层: (3)客 ...

  2. 一张图看懂片式多层陶瓷电容器(MLCC)

  3. LED驅動芯片最大特點

    最大特點是: 1.電源電壓在很寬的範圍內工作時,(約180V-265V)能保證 LED的恒功率輸出,並且 LED可實現無頻閃輸出. 2.實現安全隔離的安全電壓輸出,甚至是安全超低電壓輸出. 3.IC2 ...

  4. linux crontab 计划任务 atd和windows下的计划任务

    crontab 命令 如果发现您的系统里没有这个命令,请安装下面两个软件包. vixie-cron crontabs crontab 是用来让使用者在固定时间或固定间隔执行程序之用,换句话说,也就是类 ...

  5. 14.3 InnoDB Multi-Versioning InnoDB 多版本

    14.3 InnoDB Multi-Versioning InnoDB 多版本 InnoDB 是一个多版本的存储引擎,它保持信息关于改变的数据老版本的信息, 为了支持事务功能比如并发和回滚. 这些信息 ...

  6. SDUT2087 离散事件模拟-银行管理(模拟)

    题目链接. 分析: 模拟. 果然模拟什么的最讨厌了. 用e1,e2分别记录队列1,队列2的结束时间. 每个结点的s记录开始时间,e一开是记录逗留时间,进队列的时候,改成离开的时间.时刻记录总时间就可以 ...

  7. 第2个Wiindows程序讲解

    上次,我们一起写了一个Windows窗口程序,这个窗口程序虽然非常简单,但是,代码仍然很多,相信,一定会有很多初学者看见这些代码而感到头疼.不用怕,现在,我们就一起来分析一下这些代码,相信通过我们共同 ...

  8. POJ 3268 Silver Cow Party ( Dijkstra )

    题目大意: 有N个农场每个农场要有一头牛去参加一个聚会,连接每个农场有m条路, 聚会地点是X,并且路是单向的.要求的是所有牛赶到聚会地点并且回到自己原先的农场所需要的最短时间. 题目分析: 其实就是以 ...

  9. Error on SVN checkout:SSL handshake failed

    最近遇到了一个恼火的问题,在Ubuntu上尝试用svn命令checkout一个https的repository时遇到个错误信息: svn: E175002: Unable to connect to ...

  10. Shell遍历文件,对每行进行正则匹配

    Shell查看文件的最后5行,并对每行进行正则匹配,代码如下: #!/bin/sh pattern="HeartBeat" /home/test/log/log_20150205. ...