#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int n;
cin>>n;
int a[2*n];
for(int i=0;i<2*n;i++)
{
cin>>a[i];
}
sort(a,a+n);
long long fir=0,las=0;
for(int i=0;i<n;i++)
{
fir+=a[i];
las+=a[2*n-1-i];
}
if(fir!=las)
{
for(int i=0;i<2*n;i++)
{
cout<<a[i]<<' ';
}
}
else
{
cout<<-1;
}
return 0;
}
1
Time: 0 ms, memory: 3784 KB
Verdict: WRONG_ANSWER
Input
3
1 2 2 1 3 1
Participant's output
−1
Jury's answer
2 1 3 1 1 2
Checker comment
Wrong answer the jury found an answer while the
participant couldn't.