#include<bits/stdc++.h>
using namespace std;
typedef long long ll;


int main(){
  ll k, n, m;
  cin >> k >> n >> m;
  vector<pair<ll,ll>> S(k);
  vector<ll> A(k);
  vector<ll> B(k);
  
  for(ll i=0; i<k; i++) cin >> A[i];
  
  ll count = 0;
  for(ll i=0; i<k; i++){
    ll b = m*A[i]/n;
    if(m*A[i]%n >= n/2) b++;
    B[i] = b;
    count += b;
    S[i].first = n*b - m*A[i];
    S[i].second = i;
  }
  
  sort(S.begin(),S.end());
  
  if(count<=m){
    for(ll i=0; i<(m - count); i++){
      B[S[i].second] += 1;
    }
  }else{
    for(ll i=0; i<(count - m); i++){
      B[S[k-1-i].second] -= 1;
    }
  }
  
  for(ll i=0; i<k; i++) cout << B[i] << " ";
  cout << endl;
  
  return 0;
}
//#pragma GCC optimize ("O2")
//#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
#include<cstdio>
#include<cstring>


using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}
int tmp[100000], P[50000], Q[50000];
void pakuri_sort(int N, int A[]) {
	const int b = 8;
	rep(k, 4) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
	}
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();

	ll kotae = 0;
	rep(i, N) {
		tmp[i] = getint();
		kotae += tmp[i];
	}
	rep(i, N) {
		int b = getint();

		if (i & 1) P[i >> 1] = (b - tmp[i] + 1000000000);
		else Q[i >> 1] = (b - tmp[i] + 1000000000);
	}

	pakuri_sort(N / 2, P);
	pakuri_sort(N / 2, Q);

	int k = N / 2 - 1;
	while (k >= 0) {
		int a = P[k] - 1000000000;
		int b = Q[k] - 1000000000;
		if (a + b <= 0) break;
		kotae += a + b;
		k--;
	}

	printf("%lld\n", kotae);

	Would you please return 0;
}