#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,k;
cin>>n>>k;
int a[n + k];
for (int i = 0; i < n + k; i++) {
cin>>a[i];
}
for (int i = 0; i <= n; i++) {
int b[n];
for (int j = 0; j < n; j++)
if(j != i) b[j] = a[j];
int ans1 = 0, ans2 = 0, l = 0, r = n - 1, cnt = 0, x = b[0] + b[n - 1], ok = 1;
for (int j = 0; j < n / 2; j++) {
if(x != (b[j] + b[n - j - 1])){
ok = 0;
break;
}
}
if(ok){
for (int j = 0; j < n; j++) {
std::cout << b[j] << " ";
}
return 0;
}
}
return 0;
}
| # | 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... |