#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
vector<int>v(N);
for(int i=0;i<N;i++){
cin>>v[i];
}
sort(v.begin(),v.end());
for(int i=0;i+3<N;i++){
if(v[i]+v[i+1]+v[i+2]>v[i+3]){
cout<<v[i]<<' '<<v[i+1]<<' '<<v[i+2]<<' '<<v[i+3]<<'\n';
return 0;
}
}
cout<<-1<<'\n';
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1832 KiB | ||||
2 | Accepted | 3ms | 1952 KiB | ||||
3 | Accepted | 3ms | 2188 KiB | ||||
subtask2 | 30/30 | ||||||
4 | Accepted | 3ms | 2256 KiB | ||||
5 | Accepted | 3ms | 2392 KiB | ||||
6 | Accepted | 3ms | 2608 KiB | ||||
7 | Accepted | 3ms | 2824 KiB | ||||
8 | Accepted | 3ms | 2952 KiB | ||||
9 | Accepted | 3ms | 3168 KiB | ||||
10 | Accepted | 3ms | 3400 KiB | ||||
11 | Accepted | 3ms | 3620 KiB | ||||
12 | Accepted | 3ms | 3696 KiB | ||||
13 | Accepted | 3ms | 3800 KiB | ||||
14 | Accepted | 3ms | 3908 KiB | ||||
15 | Accepted | 3ms | 3912 KiB | ||||
subtask3 | 30/30 | ||||||
16 | Accepted | 3ms | 3904 KiB | ||||
17 | Accepted | 3ms | 4000 KiB | ||||
18 | Accepted | 3ms | 4004 KiB | ||||
19 | Accepted | 3ms | 4124 KiB | ||||
20 | Accepted | 3ms | 4212 KiB | ||||
21 | Accepted | 3ms | 4292 KiB | ||||
22 | Accepted | 3ms | 4252 KiB | ||||
23 | Accepted | 3ms | 4252 KiB | ||||
24 | Accepted | 3ms | 4480 KiB | ||||
25 | Accepted | 3ms | 4480 KiB | ||||
26 | Accepted | 3ms | 4388 KiB | ||||
27 | Accepted | 3ms | 4480 KiB | ||||
28 | Accepted | 3ms | 4612 KiB | ||||
29 | Accepted | 3ms | 4612 KiB | ||||
30 | Accepted | 3ms | 4748 KiB | ||||
subtask4 | 40/40 | ||||||
31 | Accepted | 35ms | 8092 KiB | ||||
32 | Accepted | 35ms | 9816 KiB | ||||
33 | Accepted | 35ms | 11680 KiB | ||||
34 | Accepted | 35ms | 13528 KiB | ||||
35 | Accepted | 3ms | 12244 KiB | ||||
36 | Accepted | 3ms | 12360 KiB | ||||
37 | Accepted | 3ms | 12452 KiB | ||||
38 | Accepted | 3ms | 12456 KiB | ||||
39 | Accepted | 35ms | 15592 KiB | ||||
40 | Accepted | 35ms | 17444 KiB | ||||
41 | Accepted | 3ms | 16172 KiB | ||||
42 | Accepted | 3ms | 16176 KiB | ||||
43 | Accepted | 3ms | 16272 KiB | ||||
44 | Accepted | 3ms | 16184 KiB |