fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define int long long
  5. #define yes cout << "YES\n";
  6. #define no cout << "NO\n";
  7.  
  8.  
  9. void FastIO(){
  10. ios_base::sync_with_stdio(false);
  11. cin.tie(nullptr);
  12. cout.tie(nullptr);
  13. }
  14.  
  15. void solve(){
  16. int n,m,x,y; cin >> n >> m >> x >> y;
  17.  
  18. int ans = 0;
  19.  
  20. while(n--){
  21. int a; cin >> a;
  22. if(a < y)
  23. ans++;
  24. }
  25.  
  26. while(m--){
  27. int a; cin >> a;
  28. if(a < x)
  29. ans++;
  30. }
  31.  
  32. cout << ans << "\n";
  33. }
  34.  
  35. signed main(){
  36. FastIO();
  37.  
  38. int t;
  39. cin >> t;
  40.  
  41. while(t--){
  42. solve();
  43. }
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5280KB
stdin
2
1 1 2 2
1
1
2 1 100000 100000
42 58
32
stdout
2
3