fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long int ll;
  5.  
  6. int main() {
  7. int t;
  8. cin >> t;
  9. for (int i = 0; i < t; i++) {
  10. vector<ll> arr(3);
  11. cin >> arr[0] >> arr[1] >> arr[2];
  12. sort(arr.begin(), arr.end());
  13. cout << min(arr[0] + arr[1] , arr[2]) << endl;
  14. }
  15. }
Success #stdin #stdout 0s 4420KB
stdin
2
2 3 4
1 2 5
stdout
4
3