• محدودیت زمان: ۱ ثانیه
  • محدودیت حافظه: ۲۵۶ مگابایت

Tehran municipality has set up a new charging method for the Congestion Charging Zone (CCZ) which controls the passage of vehicles in Tehran’s high-congestion areas in the congestion period (CP) from 6:30 to 19:00. There are plate detection cameras inside or at the entrances of the CCZ recording vehicles seen at the CCZ. The table below summarizes the new charging method.

The first time seen in the CP The last time seen in the CP Charge
6:30 to 10:00 6:30 to 16:00 24000
6:30 to 10:00 16:01 to 19:00 36000
10:01 to 16:00 10:01 to 16:00 16800
10:01 to 19:00 16:01 to 19:00 24000

Note that the first time and the last time that a vehicle is seen in the CP may be the same. Write a program to compute the amount of charge of a given vehicle in a specific day.

ورودی

The first line of the input contains a positive integer nn (1n1001 \leq n \leq 100) where nn is the number of records for a vehicle. Each of the next nn lines contains a time at which the vehicle is seen. Each time is of form <hour>:<minute>, where <hour> is an integer number between 00 and 2323 (inclusive) and <minute> is formatted as an exactly two-digit number between 0000 and 5959 (inclusive).

خروجی

Print the charge to be paid by the owner of the vehicle in the output.

مثال

ورودی نمونه ۱

4
7:30
2:20
7:30
17:30
Plain text

خروجی نمونه ۱

36000
Plain text

ورودی نمونه ۲

1
12:13
Plain text

خروجی نمونه ۲

16800
Plain text

ورودی نمونه ۳

2
0:30
23:30
Plain text

خروجی نمونه ۳

0
Plain text

ارسال پاسخ برای این سؤال
فایلی انتخاب نشده است.