This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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);
pas=max(pas,xc-zx);
}
}
if(pas%2==0){
cout<<pas/2<<" ";
}else{
cout<<pas/2<<".5 ";
}
}
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... |