問題一覧 > 通常問題

No.2789 hako111223’s Master Thesis

レベル : / AI推定難易度 : 109 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 176
作問者 : 👑 箱星 / テスター : dadas
お気に入りにしたユーザー ProblemId : 10598 / 自分の提出
問題文最終更新日: 2024-06-15 14:33:18
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. Back to the original
yukicoder contest 434 (順位表) の他の問題:

Problem Statement

Today is day $A$ of month $12$, and the master's thesis must be submitted by day $B$ of month $1$ of the following year.

If Hakoboshi writes the master's thesis in English, it can be submitted $C$ days later; if written in Japanese, it can be submitted $D$ days later. Here, $C\gt D$.

Print 1 if Hakoboshi can write the master's thesis in English, 2 if the master's thesis can only be written in Japanese, and 3 if the master's thesis cannot be written even in Japanese.

Constraints

  • $1\le A,B\le 31$
  • $1\le C,D\le 100$
  • $C\gt D$
  • All input values are integers

Input

The input is given from standard input in the following format.
$A$ $B$ $C$ $D$

Output

Print the answer.

Sample

Sample 1
Input
25 10 20 16
Output
2

Today is day $25$ of month $12$. If written in English, the thesis can be submitted $20$ days later, on day $14$ of month $1$; if written in Japanese, it can be submitted $16$ days later, on day $10$ of month $1$. Only Japanese meets the deadline of day $10$ of month $1$.

Sample 2
Input
1 1 8 5
Output
1

Sample 3
Input
1 31 100 99
Output
3

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