|
|
back to boardDiscussion of Problem 1607. Taxihelp me. #include <iostream.h> int main() { int P,p,T,t; cin>>P>>p>>T>>t; while(T>P) {
P+=p; T-=t; } P-=p; T+=t; if(P+p>=T) { cout<<T; return 0; } if(P+p<T) { cout<<P+p; return 0; } if(P+p==T) { cout<<P; return 0; } return 0; } |
|
|