#abc331a. A - Tomorrow

A - Tomorrow

Score : 100100 points

问题描述

在 AtCoder 王国的日历中,一年包含 MM 个月,从第 1 个月到第 MM 个月,并且每个月包含 DD 天,从第 1 天到第 DD 天。

在这个日历中,紧接在年份 yy、月份 mm、日期 dd 之后的日期是哪一天?

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

In the calendar of AtCoder Kingdom, a year consists of MM months from month 11 to month MM, and each month consists of DD days from day 11 to day DD.

What day follows year yy, month mm, day dd in this calendar?

Constraints

  • 1000y90001000 \leq y \leq 9000
  • 1mM991 \leq m \leq M \leq 99
  • 1dD991 \leq d \leq D \leq 99
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

MM DD

yy mm dd

Output

If the day following year yy, month mm, day dd in the calendar of AtCoder Kingdom is year yy', month mm', day dd', print yy', mm', and dd' in this order, separated by spaces.

Sample Input 1

12 30
2023 12 30

Sample Output 1

2024 1 1

In the calendar of the kingdom, a year consists of 1212 months, and each month consists of 3030 days. Thus, the day following year 20232023, month 1212, day 3030 is year 20242024, month 11, day 11.

Sample Input 2

36 72
6789 23 45

Sample Output 2

6789 23 46

In the calendar of the kingdom, one year consists of 3636 months, and each month consists of 7272 days. Thus, the day following year 67896789, month 2323, day 4545 is year 67896789, month 2323, day 4646.

Sample Input 3

12 30
2012 6 20

Sample Output 3

2012 6 21

update @ 2024/3/10 01:15:07