-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode2091B.cpp
More file actions
45 lines (34 loc) · 770 Bytes
/
Copy pathcode2091B.cpp
File metadata and controls
45 lines (34 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Contest : Codeforces
* Problem : 2091B - Team Training
* Link : https://codeforces.com/contest/2091/problem/B
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios::sync_with_stdio(0); cin.tie(0);
int main() {
fastio
int tc, n, x, y;
cin >> tc;
while (tc--) {
cin >> n >> x;
int vec[n];
for (int i = 0; i < n; i++) { cin >> vec[i]; }
sort(vec, vec + n, greater<>());
int cnt = 0, menor = INT_MAX, tam = 0;
for (int i = 0; i < n; i++) {
menor = min(menor, vec[i]);
tam++;
if (tam * menor >= x) {
cnt++;
menor = INT_MAX;
tam = 0;
}
// printf("%i ", vec[i]);
}
// printf("\n");
printf("%i\n", cnt);
}
return 0;
}