Alexey travel train unfortunately bad weather train move slow shouldAlexey take train railroad terminal Lets train start terminal moment 0 also let train visit n station number 1 n way Alexey destination station nAlexey learn train schedule n integer pair a_i b_i a_i expect time train arrival ith station b_i expect time departurealso information Alexey able calculate n integer tm_1 tm_2 dot tm_n tm_i extra time train need travel station 1 station formally train need exactly a_i b_i1 tm_i time travel station 1 station 1 b_0 moment train leave terminal equal 0the train leave station condition meet station leftlceil fracb_i a_i2 rightrceil unit time division ceiling current time ge b_i since Alexey spend energy prediction time delay help calculate time arrival station n