finished the time part

Input part, calculation part and output part