Started with Codeforces educational round 118, finished a and b
This commit is contained in:
39
codeforces/educational_rounds/118/b.cpp
Normal file
39
codeforces/educational_rounds/118/b.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
void test_case(int tc){
|
||||
int n;
|
||||
cin >> n;
|
||||
|
||||
vector<int> seq(n);
|
||||
|
||||
for(int i = 0; i < n; ++i){
|
||||
cin >> seq[i];
|
||||
}
|
||||
|
||||
sort(seq.begin(), seq.end());
|
||||
|
||||
for(int i = 1; i < n / 2 + 1; ++i){
|
||||
cout << seq[i] << " " << seq[0] << "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user