5574: Tomorrow明天(ABC331A)

内存限制:1024 MB 时间限制:2.000 S
评测方式:文本比较 命题人:
提交:0 解决:0

题目描述

 Problem Statement:

In the calendar of AtCoder Kingdom, a year consists of $M$ months from month $1$ to month $M$, and each month consists of $D$ days from day $1$ to day $D$.

What day follows year $y$, month $m$, day $d$ in this calendar?

在AtCoder王国的日历中,一年由M个月组成,从1月份到M月份,每个月由D天组成,从第1天到第D天。

如果在这个日历中,某一天是ymd日,请问第二天是哪一年哪一月哪一日?

输入

The input is given from Standard Input in the following format:
```
$M$ $D$
$y$ $m$ $d$
```

输出


If the day following year $y$, month $m$, day $d$ in the calendar of AtCoder Kingdom is year $y'$, month $m'$, day $d'$, print $y'$, $m'$, and $d'$ in this order, separated by spaces.

样例输入 复制

12 30
2023 12 30

样例输出 复制

2024 1 1

提示

 Constraints

-   $1000 \leq y \leq 9000$
-   $1 \leq m \leq M \leq 99$
-   $1 \leq d \leq D \leq 99$
-   All input values are integers.

来源/分类