double maxDays( int remainw,int remaino,int costw,int costo) {
double time ,e= 1e-9 ;
time = min( ( double ) remainw/ costw,( double ) remaino/ costo) ;
double remw= remainw- time * costw;
if ( remw- 0.0 < e) return time ;
double timeadd= ( double ) remw/ ( 2 * costo+ costw) ;
return time + timeadd;
}
CgkJZG91YmxlIG1heERheXMoaW50IHJlbWFpbncsaW50IHJlbWFpbm8saW50IGNvc3R3LGludCBjb3N0byl7CgkJCWRvdWJsZSB0aW1lLGU9MWUtOTsKCQkJdGltZT1taW4oKGRvdWJsZSlyZW1haW53L2Nvc3R3LChkb3VibGUpcmVtYWluby9jb3N0byk7CgkJCWRvdWJsZSByZW13PXJlbWFpbnctdGltZSpjb3N0dzsKCQkJaWYocmVtdy0wLjA8ZSkgcmV0dXJuIHRpbWU7CgkJCWRvdWJsZSB0aW1lYWRkPShkb3VibGUpcmVtdy8oMipjb3N0bytjb3N0dyk7CgkJCXJldHVybiB0aW1lK3RpbWVhZGQ7CgkJfQ==
compilation info
prog.cpp: In function ‘double maxDays(int, int, int, int)’:
prog.cpp:4:56: error: ‘min’ was not declared in this scope
time=min((double)remainw/costw,(double)remaino/costo);
^
stdout