Advertisement
Josif_tepe

Untitled

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