Last active
October 11, 2016 04:51
-
-
Save asi1024/a229a8d3eef3a8b3e087f2c512ba871e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
int R0, W0, C, R; | |
while (cin >> R0 >> W0 >> C >> R, C) { | |
int rest = max(W0 * C - R0, 0); | |
cout << (rest + R - 1) / R << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment