Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include<bits/stdc++.h>
- #include<iostream>
- #include<vector>
- #define long long long
- #define nln '\n'
- using namespace std;
- // GLobal variables: t
- int main()
- {
- long t;
- cin >> t;
- for (long i = 0; i != t; ++i)
- {
- long n, s;
- cin >> n >> s;
- vector<bool> tic(n, 0);
- for (long j = 0; j != n; ++j)
- {
- long x;
- cin >> x;
- if (x <= s)
- tic[j] = 1;
- }
- long got = 0;
- for (long j = 0; j != n; ++j)
- {
- long x;
- cin >> x;
- if (tic[j])
- got += x;
- }
- cout << got << nln;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment