Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m;
- int d;
- int n;
- int x=0;
- int y=0;
- cin>>m;
- cin>>d;
- cin>>n;
- while(m >= x){
- x +=d;
- y+=1;
- if(x >= m){
- break;
- }
- x-=n;
- }
- cout<<y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment