Advertisement
Josif_tepe

Untitled

Apr 6th, 2024
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9.     int k, n;
  10.     cin >> k >> n;
  11.    
  12.     int a[n], b[n];
  13.     for(int i = 0; i < n; i++) {
  14.         cin >> a[i];
  15.     }
  16.     for(int i = 0; i < n; i++) {
  17.         cin >> b[i];
  18.     }
  19.    
  20.     int res = 0;
  21.     for(int i = 0; i < n; i++) {
  22.         for(int j = 0; j < n; j++) {
  23.             if(a[i] + b[j] >= k) {
  24.                 res++;
  25.             }
  26.         }
  27.     }
  28.     cout << res << endl;
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement