#include <bits/stdc++.h>
#define MAX (int)40
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
int t[MAX];
for(int i = 0; i < n; i++) cin >> t[i];
sort(t, t+n);
// bruteforce
int ans = -1;
int k = n/a; // subt #1 states a == b
for(int i = 1; i <= k; i++)
{
ans = max(ans, t[n/i - 1] - t[n - i*a]);
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |