left to 1 and right to 10^7.left is less than or equal to right:
a. Calculate mid as the average of left and right.
b. Calculate the time required to travel with speed mid.
c. If the time required is less than or equal to hour, update minSpeed to mid and set right to mid - 1.
d. If the time required is greater than hour, set left to mid + 1.minSpeed if it is not -1, otherwise return -1 if it is impossible to reach on time.