Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main() {
- int k;
- cin >> k;
- int n;
- cin >> n;
- int kompanija_1[n];
- for (int i = 0; i < n; i++)
- {
- cin >> kompanija_1[i];
- }
- int kompanija_2[n];
- for (int i = 0; i < n; i++)
- {
- cin >> kompanija_2[i];
- }
- sort(kompanija_1, kompanija_1 + n);
- sort(kompanija_2, kompanija_2 + n);
- int kombinacii = 0;
- for (int i = 0; i < n; i++)
- {
- for(int j = 0; j < n; j++)
- {
- if(kompanija_1[i] + kompanija_2[j] >= k)
- {
- kombinacii++;
- }
- }
- }
- cout << kombinacii << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement