#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n, h, l;
cin >> n >> h >> l;
int rows = 0, cols = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (1 <= x && x <= h) rows++;
if (1 <= x && x <= l) cols++;
}
cout << min({rows, cols, n / 2}) << "\n";
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICAgIGlvczo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUobnVsbHB0cik7CgogICAgaW50IHQ7CiAgICBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pIHsKICAgICAgICBpbnQgbiwgaCwgbDsKICAgICAgICBjaW4gPj4gbiA+PiBoID4+IGw7CgogICAgICAgIGludCByb3dzID0gMCwgY29scyA9IDA7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgaW50IHg7CiAgICAgICAgICAgIGNpbiA+PiB4OwogICAgICAgICAgICBpZiAoMSA8PSB4ICYmIHggPD0gaCkgcm93cysrOwogICAgICAgICAgICBpZiAoMSA8PSB4ICYmIHggPD0gbCkgY29scysrOwogICAgICAgIH0KCiAgICAgICAgY291dCA8PCBtaW4oe3Jvd3MsIGNvbHMsIG4gLyAyfSkgPDwgIlxuIjsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==
NwoyIDEgMQoxIDEKNSAyIDIKMSAyIDIgMyAyCjggNCAyCjcgMiAyIDIgMyA0IDQgMgo3IDMgNgoxMCA0IDEgMyA1IDQgNgoyIDQgNAo1IDUKNyA2IDMKMTAgNCAxIDMgNSA0IDYKNCAxIDEKMSAxIDEgMQo=
7
2 1 1
1 1
5 2 2
1 2 2 3 2
8 4 2
7 2 2 2 3 4 4 2
7 3 6
10 4 1 3 5 4 6
2 4 4
5 5
7 6 3
10 4 1 3 5 4 6
4 1 1
1 1 1 1