This page is still under construction.

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

Aligned Calendar

Time limit1sMemory limit256 MB

Summary
Convert each Gregorian date into the 13-month calendar with 28-day months and report the leftover days as holidays.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

The super-villain calendar has 13 months of 28 days each, covering 364 days. The remaining one or two days of a regular year are holidays. Convert each Gregorian date to the super-villain calendar using the usual leap-year rules.

Input

The first line contains the number of test cases. Each following line has one date in YYYY MM DD format.

Output

For each date, print YYYY/M/D became YYYY/M/D. If the date is a holiday, print YYYY/M/D became a HOLIDAY instead.

Examples1

  1. Example 1

    Input
    4
    2014 01 20
    2014 01 31
    2014 03 30
    2014 12 31
    
    Expected output
    2014/1/20 became 2014/1/20
    2014/1/31 became 2014/2/3
    2014/3/30 became 2014/4/5
    2014/12/31 became a HOLIDAY