P6784 「EZEC-3」造房子(我觉得没问题啊)
#include<iostream>
using namespace std;
long long a,b,c,i;
bool o=true;
int main(){
cin>>a>>b>>c;
while(o==true){
if(a<=i){
if(i-a<=c){
a=i;
c=c-(i-a);
}
else o=false;
}
if(b<=i){
if(i-b<=c){
b=i;
c=c-(i-b);
}
else o=false;
}
i++;
}
cout<<i-1;
return 0;
}
求大神帮忙看一看