Iamtui1010

S02E10

Nov 30th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include<iostream>
  2. #include<vector>
  3.  
  4. #define long long long
  5. #define nln '\n'
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     long t;
  12.     cin >> t;
  13.     for (long i = 1; i <= t; ++i)
  14.     {
  15.         long n, x, k;
  16.         cin >> n >> x >> k;
  17.         vector<long> a;
  18.         a.resize(n+1, 0);
  19.         long cou = 0;
  20.         for (long i = 1; i <= n; ++i)
  21.             cin >> a[i];
  22.         for (long i = 1; i <= n; ++i)
  23.         {
  24.             long b;
  25.             cin >> b;
  26.             if (abs(a[i]-b) <= k)
  27.                 ++cou;
  28.         }
  29.         if (cou >= x)
  30.                 cout << "yes" << nln;
  31.             else
  32.                 cout << "no" << nln;
  33.     }
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment