#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=200005,INF=1<<30;
//const ll INF=1LL<<60;
#define ld long double

ll f(string x){
    bool ok=true;
    for(char c:x) if(c=='.') ok=false;
    if(ok){
        return stoll(x)*10000;
    }
    
    int wh=-1;
    for(int i=0;i<si(x);i++){
        if(x[si(x)-1-i]=='.'){
            wh=i;
            break;
        }
    }
    
    for(int t=0;t<4-wh;t++) x+='0';
    ll res=0;
    
    for(int i=0;i<si(x);i++){
        if(x[i]=='.') continue;
        res*=10;
        res+=ll(x[i]-'0');
    }
    
    return res;
}

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string XX,YY,RR;cin>>XX>>YY>>RR;
    ll sx=f(XX),sy=f(YY),sr=f(RR);
    
    ld X,Y,R;
    X=(ld)sx/10000;
    Y=(ld)sy/10000;
    R=(ld)sr/10000;
    
    ll ans=0;
    
    //cout<<sx<<" "<<sy<<" "<<sr<<" "<<X<<" "<<Y<<" "<<R<<endl;
    
    for(ll x=X-R-3;x<=X+R+3;x++){
        if(abs(sx-x*10000)>sr) continue;
        
        ld rem=R*R-(X-x)*(X-x);
        
        ll y1=Y-sqrt(rem)-3,y2=Y+sqrt(rem)+3;
        
        while(1){
            if((sy-y1*10000)*(sy-y1*10000)+(sx-x*10000)*(sx-x*10000)>sr*sr) y1++;
            else break;
            
            if(y1>y2) break;
        }
        
        if(y1>y2) continue;
        
        while(1){
            if((sy-y2*10000)*(sy-y2*10000)+(sx-x*10000)*(sx-x*10000)>sr*sr) y2--;
            else break;
            
            if(y1>y2) break;
        }
        
        if(y1<=y2) ans+=(y2-y1+1);
        
    }
    
    cout<<ans<<endl;
}

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fill0(a) memset(a,0,sizeof(a))
#define fill1(a) memset(a,-1,sizeof(a))
#define fillbig(a) memset(a,63,sizeof(a))
#define pb push_back
#define ppb pop_back
#define mp make_pair
template<typename T1,typename T2> void chkmin(T1 &x,T2 y){if(x>y) x=y;}
template<typename T1,typename T2> void chkmax(T1 &x,T2 y){if(x<y) x=y;}
typedef pair<int,int> pii;
typedef long long ll;
typedef unsigned int u32;
typedef unsigned long long u64;
namespace fastio{
	#define FILE_SIZE 1<<23
	char rbuf[FILE_SIZE],*p1=rbuf,*p2=rbuf,wbuf[FILE_SIZE],*p3=wbuf;
	inline char getc(){return p1==p2&&(p2=(p1=rbuf)+fread(rbuf,1,FILE_SIZE,stdin),p1==p2)?-1:*p1++;}
	inline void putc(char x){(*p3++=x);}
	template<typename T> void read(T &x){
		x=0;char c=getchar();T neg=0;
		while(!isdigit(c)) neg|=!(c^'-'),c=getchar();
		while(isdigit(c)) x=(x<<3)+(x<<1)+(c^48),c=getchar();
		if(neg) x=(~x)+1;
	}
	template<typename T> void recursive_print(T x){if(!x) return;recursive_print(x/10);putc(x%10^48);}
	template<typename T> void print(T x){if(!x) putc('0');if(x<0) putc('-'),x=~x+1;recursive_print(x);}
	void print_final(){fwrite(wbuf,1,p3-wbuf,stdout);}
}
const int MAXN=1e5;
int n,s1,s2,a[MAXN+5],b[MAXN+5];
priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > > ls,mr;
int main(){
	scanf("%d%d%d",&n,&s1,&s2);int sum=0;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++){
		int lw=1ll*a[i]*s2/s1,up=lw+1;
		if(abs(1ll*lw*s1-1ll*a[i]*s2)<abs(1ll*up*s1-1ll*a[i]*s2))
			b[i]=lw,ls.push(mp(abs(1ll*up*s1-1ll*a[i]*s2),i));
		else b[i]=up,mr.push(mp(abs(1ll*lw*s1-1ll*a[i]*s2),i));
		sum+=b[i];//printf("%d\n",b[i]);
	}
//	printf("%d\n",sum);
	if(sum>s2){
		for(int i=1;i<=sum-s2;i++){
			pair<int,int> p=mr.top();mr.pop();
			b[p.se]--;
		}
	} else {
		for(int i=1;i<=s2-sum;i++){
			pair<int,int> p=ls.top();ls.pop();
			b[p.se]++;
		}
	}
	for(int i=1;i<=n;i++) printf("%d ",b[i]);printf("\n");
	return 0;
}
/*
3 1000 999
333 333 334
*/