diff options
Diffstat (limited to 'codechef/TheSmallestPair/main.cpp')
| -rw-r--r-- | codechef/TheSmallestPair/main.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/codechef/TheSmallestPair/main.cpp b/codechef/TheSmallestPair/main.cpp new file mode 100644 index 0000000..7b77a41 --- /dev/null +++ b/codechef/TheSmallestPair/main.cpp @@ -0,0 +1,18 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n; + cin >> n; + vector<int> v(n); + for(int& x : v) cin >> x; + sort(v.begin(), v.end()); + cout << v[0] + v[1] << endl; + } +} |
