|
|
back to boardDiscussion of Problem 1607. TaxiWA#1 Posted by ooo 16 Dec 2008 00:06 #include <iostream.h> int main() {int a,b,c,d; cin>>a>>b>>c>>d; if(a>=c) cout<<a; else {while(((a+b)<=c) && ((c-d)>(a+b))) {a+=b; c-=d;} if((a+b)>c) cout<<c; else cout<<a;} return 0;} |
|
|