an underground railway system keep track customer travel time different station they datum calculate average time take travel station anotherimplement UndergroundSystem classvoid checkinint i d string stationname int ta customer card ID equal i d check station stationname time tA customer check place timevoid checkoutint i d string stationname int ta customer card ID equal i d check station stationname time tdouble getaveragetimestre startstation stre endstationreturn average time take travel startstation endstationthe average time compute previous traveling time startstation endstation happen directly mean check startstation follow check endstationthe time take travel startstation endstation different time take travel endstation startStationThere customer travel startstation endstation getaveragetime calledyou assume call checkin checkout method consistent if customer check time t1 check time t2 t1 t2 all event happen chronological order Example 1InputUndergroundSystemcheckIncheckIncheckIncheckOutcheckOutcheckOutgetAverageTimegetAverageTimecheckIngetAverageTimecheckOutgetAverageTime45Leyton332Paradise827Leyton1045Waterloo1527Waterloo2032Cambridge22ParadiseCambridgeLeytonWaterloo10Leyton24LeytonWaterloo10Waterloo38LeytonWaterlooOutputnullnullnullnullnullnullnull14000001100000null1100000null1200000ExplanationUndergroundSystem undergroundSystem new UndergroundSystemundergroundSystemcheckIn45 Leyton 3undergroundsystemcheckin32 Paradise 8undergroundsystemcheckin27 Leyton 10undergroundsystemcheckout45 Waterloo 15 Customer 45 Leyton Waterloo 153 12undergroundsystemcheckout27 Waterloo 20 Customer 27 Leyton Waterloo 2010 10undergroundsystemcheckout32 Cambridge 22 Customer 32 Paradise Cambridge 228 14undergroundsystemgetaveragetimeparadise Cambridge return 1400000 one trip Paradise Cambridge 14 1 14undergroundsystemgetaveragetimeleyton Waterloo return 1100000 two trip Leyton Waterloo 10 12 2 11undergroundsystemcheckin10 Leyton 24undergroundsystemgetaveragetimeleyton Waterloo return 1100000undergroundsystemcheckout10 Waterloo 38 Customer 10 Leyton Waterloo 3824 14undergroundsystemgetaveragetimeleyton Waterloo return 1200000 three trip Leyton Waterloo 10 12 14 3 12example 2inputundergroundsystemcheckincheckoutgetaveragetimecheckincheckoutgetaveragetimecheckincheckoutgetaveragetime10leyton310paradise8leytonparadise5leyton105paradise16leytonparadise2leyton212paradise30leytonparadiseoutputnullnullnull500000nullnull550000nullnull666667explanationundergroundsystem undergroundSystem new undergroundsystemundergroundsystemcheckin10 Leyton 3undergroundsystemcheckout10 Paradise 8 Customer 10 Leyton Paradise 83 5undergroundsystemgetaveragetimeleyton Paradise return 500000 5 1 5undergroundsystemcheckin5 Leyton 10undergroundsystemcheckout5 Paradise 16 Customer 5 Leyton Paradise 1610 6undergroundsystemgetaveragetimeleyton Paradise return 550000 5 6 2 55undergroundsystemcheckin2 Leyton 21undergroundsystemcheckout2 Paradise 30 Customer 2 Leyton Paradise 3021 9undergroundsystemgetaveragetimeleyton Paradise return 666667 5 6 9 3 666667 Constraints1 i d t 1061 stationnamelength startstationlength endstationlength 10all string consist uppercase lowercase english letter digitsthere 2 104 call total checkin checkout getaveragetimeanswer 105 actual value accept