#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,i,j,ii,jj,zx,xc,N,M,D,f[400009],pas;
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>N>>M>>D;a=N+M;
for(i=1; i<=a; i++){
cin>>f[i];
}
for(ii=N+1; ii<=a; ii++){
sort(f+1,f+ii+1);pas=0;
for(i=1; i<=ii; i++){
for(j=i+1; j<=ii; j++){
zx=f[i]-i*D;xc=f[j]-j*D;
pas=max(pas,zx-xc);
}
}
if(pas%2==0){
cout<<pas/2<<" ";
}else{
cout<<pas/2<<".5 ";
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
22 ms |
340 KB |
Output is correct |
2 |
Correct |
22 ms |
340 KB |
Output is correct |
3 |
Correct |
27 ms |
336 KB |
Output is correct |
4 |
Correct |
25 ms |
340 KB |
Output is correct |
5 |
Correct |
26 ms |
340 KB |
Output is correct |
6 |
Correct |
24 ms |
340 KB |
Output is correct |
7 |
Correct |
21 ms |
340 KB |
Output is correct |
8 |
Correct |
22 ms |
356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
22 ms |
340 KB |
Output is correct |
2 |
Correct |
22 ms |
340 KB |
Output is correct |
3 |
Correct |
27 ms |
336 KB |
Output is correct |
4 |
Correct |
25 ms |
340 KB |
Output is correct |
5 |
Correct |
26 ms |
340 KB |
Output is correct |
6 |
Correct |
24 ms |
340 KB |
Output is correct |
7 |
Correct |
21 ms |
340 KB |
Output is correct |
8 |
Correct |
22 ms |
356 KB |
Output is correct |
9 |
Execution timed out |
1553 ms |
3204 KB |
Time limit exceeded |
10 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1582 ms |
1996 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1582 ms |
1996 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |