// Calculate the first whole unit count whose positive contribution margin covers fixed overhead. Return minus one for a nonpositive margin. pub fn break_even_units(fixed: i64, unit_price: i64, variable_cost: i64) -> i64 { if fixed<0 || variable_cost<0 || unit_price <= variable_cost { return -1; } let margin = unit_price-variable_cost; fixed/margin+if fixed%margin>0 { 1 } else { 0 } }