#include int main(){ unsigned int a,b,x,N; scanf("%d %d %d %d",&a,&b,&x,&N); int tw=0,tb=0,aw=0,ab=0; for(int i=0,pt=0,pa=0;i