Find minimum value of I so that truck can avoid the dead end