P27823 [洛谷] Double Eleven
普及
题目描述

Problem Description

Every year on November 11th, various online stores have promotional activities, so everyone hopes that November 11th falls on a weekend, making shopping more enjoyable. Please write a program to calculate the number of times November 11th falls on a weekend (Saturday or Sunday) within a given period. The following definitions and facts about dates may help you:
- January 1st, 1900, was a Monday.
- Months January, March, May, July, August, October, and December have 31 days; April, June, September, and November have 30 days; February has 29 days in a leap year and 28 days in a non-leap year.
- Leap year calculation method: Years not divisible by 100 are called common years. Common years divisible by 4 are leap years, so 2004 is a leap year, and 1999 is not; Years divisible by 100 are called century years. Century years divisible by 400 are leap years, so 2000 is a leap year, and 1900 is not.

Input Format

Input consists of two integers $x, y$ on a single line, representing the start and end years to be calculated.

Output Format

Output a single integer, the number of years from year $x$ to year $y$ (including $x$ and $y$) where November 11th falls on a weekend.

Sample Input and Output

Sample Input #1

2018 2018

Sample Output #1

1

Sample Input #2

2018 2100

Sample Output #2

23

Notes

Sample Explanation

Sample 1

November 11th, 2018, was a Sunday.

Sample 2

There are 23 instances between 2018 and 2100 where November 11th falls on a weekend.

Data Size

All data satisfies $1900 ≤ x ≤ y ≤ 3000$.

The original full score for this problem was $15\text{pts}$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
2018 2018
样例输出
1