#K93847. Calculate Fare

    ID: 38510 Type: Default 1000ms 256MiB

Calculate Fare

Calculate Fare

You are given a day and time, and you have to calculate the fare for a taxi ride based on the following rules:

  • For weekdays (Monday to Friday): If the time is between \(06:00\) and \(09:00\) (inclusive) or between \(16:00\) and \(19:00\) (inclusive), the fare is \(10\). Otherwise, the fare is \(5\).
  • For weekends (Saturday and Sunday): If the time is between \(08:00\) and \(12:00\) (inclusive), the fare is \(8\). Otherwise, the fare is \(6\).

The input consists of multiple pairs: each pair contains a day (a string) and a time (in HH:MM 24-hour format). The sequence of pairs terminates when a line with "END" is encountered (this will only appear in a day slot and not as a time).

Your task is to process the input and, for each valid pair, print the corresponding fare on a new line.

inputFormat

The input is read from standard input (stdin) and is organized as follows:

  • Each two consecutive lines represent a day and a time in HH:MM format, respectively.
  • The input terminates immediately when a line containing "END" is encountered. This will always be in the position of a day.

You can assume that the input is well-formed.

outputFormat

For each day and time pair (except the terminating "END"), output the fare on a separate line to standard output (stdout).

Do not output any extra text or formatting.

## sample
Monday
07:30
Friday
18:15
Saturday
10:00
Sunday
13:45
Wednesday
20:05
END
10

10 8 6 5

</p>