Advertisement
Josif_tepe

Untitled

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