No.2789 hako111223’s Master Thesis
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もしくは右上の雲マークをクリックしてアカウントを作成してください。