w<=1e5
x+y+z=n
赢 平局 输
wx+dy=p分
https://codeforces.com/contest/1244/problem/C
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
typedef long long ll;
ll n,p,w,d;
int main(){
cin>>n>>p>>w>>d;
for(ll y=0;y<=1e5;y++){ //枚举平局 考虑赢和平局 前面场数比较小<总场数 肯定够周期%w=1e5
if((p-y*d)%w==0){
ll x=(p-y*d)/w;
if(x+y<=n && x>=0){
cout<<x<<" "<<y<<" "<<n-x-y<<endl;
return 0;
}
}
}
cout<<-1<<endl;
return 0;
}