問題一覧 > 通常問題

No.3402 [Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 43
作問者 : 👑 Kazun / テスター : 👑 p-adic
お気に入りにしたユーザー ProblemId : 12715 / 自分の提出
問題文最終更新日: 2026-05-18 22:58:53
[Cherry Anniversary 5] Beyond Zelkova, the 5th year vista seen through the bloom of a cherry bloosom
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
Advent Calendar Contest 2025 (順位表) の他の問題:

Problem Statement

An idol group formed on $m_s$/$d_s$ of year $y_s$ ended its activities on $m_e$/$d_e$ of year $y_e$, and starting the next day it began activities under a new group name.

Answer the following $Q$ questions.

  • As of $m$/$d$ of year $y$, compare the number of days of activity under the name after the renaming with the number of days of activity under the name before the renaming.
  • Strictly speaking, answer the following question.
    • Let the integer $b$ be the number of days in the period of activity under the name before the renaming. That is, let $b$ be the number of days from $m_s$/$d_s$ of year $y_s$ to $m_e$/$d_e$ of year $y_e$, inclusive of both days.
    • Let the integer $a$ be the number of days in the period of activity under the name after the renaming. That is, let $a$ be the number of days from the day after $m_e$/$d_e$ of year $y_e$ to $m$/$d$ of year $y$, inclusive of both days.
    • Which of $a \lt b, a = b, a \gt b$ holds?
  • Here, assume that this idol group has not been renamed since the renaming on $m_e$/$d_e$ of year $y_e$.
  • It is also guaranteed that $m$/$d$ of year $y$ is a date on which the group is active under the name after the renaming.

The calendar used in this problem is the Gregorian calendar (the calendar currently used in Japan and many other countries around the world).

Constraints

  • $m_s$/$d_s$ of year $y_s$ and $m_e$/$d_e$ of year $y_e$ are dates that exist in the Gregorian calendar.
  • $m_s$/$d_s$ of year $y_s$ is on or after $4$/$1$ of year $1962$ (the same date is allowed).
  • $m_e$/$d_e$ of year $y_e$ is on or after $m_s$/$d_s$ of year $y_s$ (the same date is allowed).
  • $1 \leq Q \leq 3 \times 10^4$.
  • Constraints for each question
    • $y \leq 2025$.
    • $m$/$d$ of year $y$ is a date that exists in the Gregorian calendar.
    • $m$/$d$ of year $y$ is a date on which the group is active under the name after the renaming.
  • All inputs are integers.

Input

The input is given from standard input in the following format.

$y_s$ $m_s$ $d_s$
$y_e$ $m_e$ $d_e$
$Q$
$\textrm{Question}_1$
$\textrm{Question}_2$
$\vdots$
$\textrm{Question}_Q$

Each question $\textrm{Question}_q$ is given in the following format.

$y$ $m$ $d$

Output

The output consists of $Q$ lines. On line $q~(1 \leq q \leq Q)$, output the answer to question $q$ as follows.

  • If the number of days of activity under the name after the renaming is less than the number of days of activity under the name before the renaming $(a \lt b)$, output Less.
  • If the number of days of activity under the name after the renaming is equal to the number of days of activity under the name before the renaming $(a = b)$, output Same.
  • If the number of days of activity under the name after the renaming is greater than the number of days of activity under the name before the renaming $(a \gt b)$, output More.

Do not forget the newline at the end.

Sample

Sample 1
Input
2015 8 21
2020 10 13
3
2025 12 6
2025 12 7
2025 12 9
Output
Less
Same
More

The idol group was formed on $8$/$21$ of year $2015$ and ended its activities under that name on $10$/$13$ of year $2020$. That is, the period of activity under the name before the renaming is $1881$ days. That is, $b = 1881$. The group's activities under the name after the renaming started on $10$/$14$ of year $2020$.

  • [Question $1$] As of $12$/$6$ of year $2025$, the number of days of activity under the name after the renaming is $1880$. That is, $a = 1880$. Then $a < b$, so you must output Less.
  • [Question $2$] As of $12$/$7$ of year $2025$, the number of days of activity under the name after the renaming is $1881$. That is, $a = 1881$. Then $a = b$, so you must output Same.
  • [Question $3$] As of today, $12$/$9$ of year $2025$, the number of days of activity under the name after the renaming is $1883$. That is, $a = 1883$. Then $a > b$, so you must output More.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。