Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #define long long long
- #define nln '\n'
- using namespace std;
- int main()
- {
- long t;
- cin >> t;
- for (long i = 1; i <= t; ++i)
- {
- long n, x, k;
- cin >> n >> x >> k;
- vector<long> a;
- a.resize(n+1, 0);
- long cou = 0;
- for (long i = 1; i <= n; ++i)
- cin >> a[i];
- for (long i = 1; i <= n; ++i)
- {
- long b;
- cin >> b;
- if (abs(a[i]-b) <= k)
- ++cou;
- }
- if (cou >= x)
- cout << "yes" << nln;
- else
- cout << "no" << nln;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment