#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////////
#define int long long
#define endl "\n"
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define INF 0x3F3F3F3F3F3F3F3F
#define ss second
#define ff first
#define pb push_back
#define ins insert
#define fori for(int i = 0 ; i < n ; i ++)
///////////////////////////////////////////////
const int sz = 2e3 + 5 ;
const int LG = 20 ;
const int N = 1e3 ;
const int mod = 1e9 + 7 ;
const int MAXM = 1e5 ;
///////////////////////////////////////////////
///////////////////////////////////////////////
void solve() {
int n ;
cin >> n ;
int k ;
cin >> k ;
int m = n + k ;
vector<int>a(m) ;
for(int i = 0 ; i < m ; i ++) cin >> a[i] ;
map<int , int>mp ;
sort(a.begin() , a.end()) ;
for(int i = 0 ; i < m ; i ++) {
vector<int>check ;
for(int j = i ; j < i + n ; j ++) {
check.pb(a[j]) ;
}
cout<<endl<<endl;
int l = 0 ;
int r = check.size() - 1 ;
set<int>st ;
bool b = false ;
while(l <= r) {
int sum = check[l] + check[r] ;
l ++ ;
r -- ;
st.insert(sum) ;
}
if(st.size() == 1){
for(int W = 0 ; W < check.size() ; W ++) {
cout << check[W] << ' ' ;
}
return ;
}
}
cout << "SELAMUN ALEYKUM LAN !" ;
}
///////////////////////////////////////////////
///////////////////////////////////////////////
signed main() {
IO ;
int t = 1 ; // cin >> t ;
while(t --) {
solve() ;
cout << endl ;
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |