Under construction

Still being built. Things may change

November (11月)

Time limit2sMemory limit1024 MB

Summary
Given day A of November 2022 and a number of weeks B, print 1 if the day B weeks later is still in November, otherwise 0.
Level

Easy1 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

Two integers A and B are given.

Output 1 if the day that is B weeks after day A of November 2022 falls in November 2022, and 0 otherwise.

November 2022 has 30 days, from November 1 to November 30, 2022. The day x weeks later is the day (7 × x) days later.

Input

The input is given in the following format.

A
B

Output

Output 1 if the day that is B weeks after day A of November 2022 falls in November 2022, and 0 otherwise.

Constraints

  • 1 ≦ A ≦ 30.
  • 1 ≦ B ≦ 5.
  • All input values are integers.

Examples3

  1. Example 1

    Input
    19
    1
    
    Expected output
    1
    
  2. Example 2

    Input
    3
    4
    
    Expected output
    0
    
  3. Example 3

    Input
    8
    3
    
    Expected output
    1