#include #include #include #include int main(){ unsigned N,K,X,Y; std::cin>>N>>K>>X>>Y; std::vector A(N); int hp; for (unsigned i=0;i>hp; A[i]=(unsigned)ceill((long double)(hp-1)/K); std::cout<()); if(Y/X<(unsigned)A.size()){ hp=A[Y/X]; UsedMp+=A[Y/X]*Y; }else{ hp=0; } for(unsigned i=0;i