欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1840C.Ski Resort
Ski Resort
Dima Vatrushin is a math teacher at school. He was sent on vacation for days for his good work. Dima has long dreamed of going to a ski resort, so he wants to allocate several consecutive days and go skiing. Since the vacation requires careful preparation, he will only go for at least days.
You are given an array containing the weather forecast at the resort. That is, on the -th day, the temperature will be degrees.
Dima was born in Siberia, so he can go on vacation only if the temperature does not rise above degrees throughout the vacation.
Unfortunately, Dima was so absorbed in abstract algebra that he forgot how to count. He asks you to help him and count the number of ways to choose vacation dates at the resort.
Input
The first line of the input contains an integer () — the number of test cases.
Then follow the descriptions of the test cases.
The first line of each test case contains three integers , , (, , ) — the length of the array , the minimum number of days at the resort, and the maximum comfortable temperature for Dima.
The second line of each test case contains integers () — the temperature at the ski resort.
The sum of all values over all test cases does not exceed .
Output
Output integers, each of which is the answer to the corresponding test case — the number of ways for Dima to choose vacation dates at the resort.
Note
In the first test case of the example, Dima can go on any day, so the suitable dates for him are [1], [2], [3], [1, 2], [2, 3], [1, 2, 3].
In the second and fourth test cases of the example, Dima cannot go on any day due to the high temperature, so there are no suitable dates.
In the third test case of the example, Dima can only go on the dates [1, 2, 3].
Samples
7
3 1 15
-5 0 -10
5 3 -33
8 12 9 0 5
4 3 12
12 12 10 15
4 1 -5
0 -1 2 5
5 5 0
3 -1 4 -5 -3
1 1 5
5
6 1 3
0 3 -2 5 -4 -4
6
0
1
0
0
1
9
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |