This page is still under construction.

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

Date in Seoul

Time limit1sMemory limit256 MB

Summary
Add nine hours to the given UTC date output and print the resulting Seoul calendar date as YYYY-MM-DD.
Level

Easy2 of 10

Topics
Implementation
Solved
No attempts yet

Problem

The judging server runs in UTC+0. Given the output of the date command on that server, print the date in Seoul at that instant. Seoul uses KST, which is 9 hours ahead of UTC and never shifts for daylight saving time.

Input

The first line holds one line of date output in the format %a %b %e %H:%M:%S UTC %Y.

  • %a: the three letter English weekday abbreviation (Sun, Mon, Tue, Wed, Thu, Fri, Sat)
  • %b: the three letter English month abbreviation (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)
  • %e: the day of the month, right aligned in a width of two. Days 1 to 9 are preceded by one space.
  • %H:%M:%S: the hour, the minute, and the second, each written with two digits
  • %Y: the four digit year

The weekday abbreviation matches the date. The year is at least 1970 and at most 9999, and the Seoul time, 9 hours later, does not pass 23:59:59 on December 31 of the year 9999.

Output

Print the Seoul date at that instant on one line in YYYY-MM-DD format. Pad the year to four digits and the month and the day to two digits.

Hint

Adding 9 hours to the given time gives the Seoul time. When the date advances, the month and the year can advance with it, so handle leap years.

Examples3

  1. Example 1

    Input
    Wed Mar 21 05:07:38 UTC 2018
    
    Expected output
    2018-03-21
    
  2. Example 2

    Input
    Sat Jan 24 15:00:00 UTC 2015
    
    Expected output
    2015-01-25
    
  3. Example 3

    Input
    Sat Jan 24 14:59:59 UTC 2015
    
    Expected output
    2015-01-24