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;
int main(){
int n,m,k;
cin>>n>>m>>k;
vector<int> arr(n);
vector<int> barr(m);
for (int i = 0; i < n; ++i)
{
cin>>arr[i];
}
for (int i = 0; i < m; ++i)
{
cin>>barr[i];
}
int minel = -1;
int maxel = -1;
int crr = 0;
function<void(int)> add = [&](int x)->void{
crr++;
if (minel==-1) minel=x;
if (maxel==-1) maxel=x;
minel=min(minel,x);
maxel=max(maxel,x);
};
for (int i = 0; i < n; ++i)
{
add(arr[i]);
}
for (int i = 0; i < m; ++i)
{
add(barr[i]);
int hh = (crr-1)*k-(maxel-minel);
cout<<hh/2;
if (hh%2) cout<<".5";
cout<<" ";
}
cout<<endl;
}
# | 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... |