思路
签到题
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 5;
int a[MAXN];
void solve() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; ++i) {
scanf("%d", &a[i]);
}
int ans = 0;
for (int i = 0; i < n; ++i) {
if (a[i] >= m) {
a[i] -= m;
ans++;
}
a[i + 1] += a[i] / 2;
}
printf("%d\n", ans);
}
int main() {
int t;
scanf("%d", &t);
for (int i = 0; i < t; ++i) {
solve();
}
return 0;
}