Problem: Problem - A - Codeforces
I’ve checked for all car such that car[i]>=weight[i] and car[i]<=2*weight[i] . So all bears are now satisfied.
Now misha is causing all the problem with my code I think:
signed main(){
vi v(3);cin>>v;
int vm;cin>>vm;
for(int c22=v[2];c22<=2*v[2];c22++){
for(int c11=v[1];c11<=2*v[1] && c11>c22;c11++){
for(int c00=v[0];c00<=2*v[0] && c00>c11;c00++){
if(c00>=vm && c11>=vm && c22>=vm && c22<=2*vm){
cout<<c00<<"\n"<<c11<<"\n"<<c22;
return 0;
}
}
}
}
cout<<-1;
}
Thanks!