|
|
вернуться в форумCould you give me some tests , Got WA#13 Please help me I got WA test13 I had done everything plz help. Thank you beforehand. //1607. Taxi #include <iostream> using namespace std; int main() { int a,b,c,d,i,m; cin>>a>>b>>c>>d; if(a>=c) cout<<a<<endl; else { if(b<d) m=b; else m=d; for(i=1;c-d*(i-1)-a-b*i>m;i++); if(c-d*(i-1)-a-b*i>=0) cout<<a+b*i<<endl; else cout<<c-d*(i-1)<<endl; } return 0; } |
|
|