aboutsummaryrefslogtreecommitdiff
path: root/codechef/TheSmallestPair
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/TheSmallestPair')
-rwxr-xr-xcodechef/TheSmallestPair/mainbin0 -> 44568 bytes
-rw-r--r--codechef/TheSmallestPair/main.cpp18
-rw-r--r--codechef/TheSmallestPair/main_input0.txt3
-rw-r--r--codechef/TheSmallestPair/main_output0.txt1
4 files changed, 22 insertions, 0 deletions
diff --git a/codechef/TheSmallestPair/main b/codechef/TheSmallestPair/main
new file mode 100755
index 0000000..08ae671
--- /dev/null
+++ b/codechef/TheSmallestPair/main
Binary files differ
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;
+ }
+}
diff --git a/codechef/TheSmallestPair/main_input0.txt b/codechef/TheSmallestPair/main_input0.txt
new file mode 100644
index 0000000..ab88d90
--- /dev/null
+++ b/codechef/TheSmallestPair/main_input0.txt
@@ -0,0 +1,3 @@
+1
+4
+5 1 3 4
diff --git a/codechef/TheSmallestPair/main_output0.txt b/codechef/TheSmallestPair/main_output0.txt
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/codechef/TheSmallestPair/main_output0.txt
@@ -0,0 +1 @@
+4