包堆德
2024-07-31 17:19:57
发布于:浙江
6阅读
0回复
0点赞
#include<iostream>
using namespace std;
int main()
{
long long counto,countx,maxo,maxx;
while (cin>>counto>>countx>>maxo>>maxx)
{
maxo=min(counto,maxo);
maxx=min(countx,maxx);
if (maxo0) cout<<maxx<<endl;
else if (maxx0) cout<<maxo<<endl;
else if ((counto+1)*maxx<countx) cout<<(counto+1)*maxx+counto<<endl;
else if ((countx+1)*maxo<counto) cout<<(countx+1)*maxo+countx<<endl;
else cout<<counto+countx<<endl;
}
return 0;
}
这里空空如也
有帮助,赞一个