编程介的小学生 2019-05-17 12:51 采纳率: 20.5%
浏览 125

按照顺序排列的得分去计算应该选择哪个人,怎么采用C程序的语言代码编写的过程的方式实现?

Problem Description
Anti-terrorism is becoming more and more serious nowadays. The country now has n soldiers,and every solider has a score.

We want to choose some soldiers to fulfill an urgent task. The soldiers chosen must be adjacent to each other in order to make sure that they can cooperate well. And all the soldiers chosen must have an average score greater than a.

Now, please calculate how many ways can the chief of staff choose the soldiers.

Input
The first line consists of a single integer t, indicating number of test cases.

For each test case, the first line gives n, the number of soldiers, and a, the minimum possible average score(n<=100000,a<=10000). The second line gives n integers, corresponding to the soldiers' scores in order. All the scores are no greater than 10000.

Output
An integer n, number of ways to choose the soldiers.

Sample Input
2
5 3
1 3 7 2 4
1 1000
9999

Sample Output
10
1

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 spring后端vue前端
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题