Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 28th, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int T, n, m, x;
  4. int main()
  5. {
  6.     ios_base::sync_with_stdio(0);
  7.     cin.tie(0);
  8.     cout.tie(0);
  9.     cin >> T;
  10.     while(T--)
  11.     {
  12.         cin >> n >> m;
  13.         int s = 0, s1 = 0;
  14.         for(int i=1; i<=n; i++)
  15.         {
  16.             cin >> x;
  17.             s+=x;
  18.         }
  19.         for(int i=1; i<=m; i++)
  20.         {
  21.             cin >> x;
  22.             s1+=x;
  23.         }
  24.         cout << min(s, min(s1, n*m)) << '\n';
  25.     }
  26.     return 0;
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top