This page is still under construction.

Parts of this page are still being built. What you see may change.

Good Times

Time limit1sMemory limit128 MB

Summary
Given the time in Ottawa as hour*100+minute, print the local time in seven Canadian cities using fixed offsets, wrapping across midnight.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

A mobile phone provider in Ottawa broadcasts an automatic time signal to its subscribers that shows the correct local time wherever they are in Canada, so that every text message carries a valid local timestamp.

Canada spans six time zones. For example, when it is 1420 in Ottawa (Eastern Time), the local time in a representative city of each zone is as follows.

Time zoneCity and local time
Pacific TimeVictoria: 1120
Mountain TimeEdmonton: 1220
Central TimeWinnipeg: 1320
Eastern TimeToronto: 1420
Atlantic TimeHalifax: 1520
Newfoundland TimeSt. John's: 1550

Ottawa is on Eastern Time. Relative to Ottawa the offsets are Victoria -3h, Edmonton -2h, Winnipeg -1h, Toronto 0, Halifax +1h, and St. John's +1h30m.

Given the current time in Ottawa in 24-hour format, output the corresponding local time in Ottawa, Victoria, Edmonton, Winnipeg, Toronto, Halifax, and St. John's.

Input

A single integer, the current time in Ottawa in 24-hour form. Midnight is 0, one minute past midnight is 1, 13 minutes past midnight is 13, and one minute before midnight is 2359. Formally the value is hour * 100 + minute with 0 <= hour <= 23 and 0 <= minute <= 59. The input contains no extra leading zeros.

Output

Print seven lines, one per city, in this order: Ottawa, Victoria, Edmonton, Winnipeg, Toronto, Halifax, St. John's. Each line has the form <time> in <City>, where the word in is printed literally and <time> is that city's local time written the same way as the input (hour * 100 + minute, with no leading zeros). The city names are printed in English exactly as Ottawa, Victoria, Edmonton, Winnipeg, Toronto, Halifax, St. John's. For example, midnight prints as 0 and 0:59 prints as 59.

Examples2

  1. Example 1

    Input
    1300
    
    Expected output
    1300 in Ottawa
    1000 in Victoria
    1100 in Edmonton
    1200 in Winnipeg
    1300 in Toronto
    1400 in Halifax
    1430 in St. John's
    
  2. Example 2

    Input
    1420
    
    Expected output
    1420 in Ottawa
    1120 in Victoria
    1220 in Edmonton
    1320 in Winnipeg
    1420 in Toronto
    1520 in Halifax
    1550 in St. John's