|
|
back to boardDiscussion of Problem 1607. TaxiPlease HELP ME WA 14 #include<iostream> #include<math.h> #include<algorithm> #include<string.h> using namespace std; int a,b,c,d; int main() { cin >> a >> b >> c >> d; int h = c; if(a >= c) { cout << a; return 0; } while(1) { if(a == c) { cout << a; return 0; } a+=b; if(c-d >= a) c-=d; else { if(a > h) cout << h; else cout << a; return 0; } } return 0; } |
|
|