If we can survive then we can buy ceil ( A / N ) times where A is total units of food required .
let days = ( M * S ) / N ; if ( ( ( M * S ) % N ) != 0 ) days ++ ; document . write ( " " + Math . round ( days ) ) ; } }