Geeky Year
Submissions: 800   Accuracy:

17.58%

  Difficulty: Easy   Marks: 2

It is given to you that on 1st January 2001 it was monday. Let's call a year as Geeky if the 1st January of that year happens to be on Sunday. You will be given two years 'a' and 'b'. The task is to find the no. of Geeky years between those two years (including 'a' and 'b' as well)

Input:
The first line of input contains an Integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line containing two integer values denoting the two years 'a' and 'b'. 

Output:
Corresponding to each test case, print the number of Geeky years for each interval in a new  line.

Constraints:
1 <= T <= 1000

1000 <= a <= b <= 3000

Example:

Input:
1
2001 2013

Output:
2

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Jha
Author: Ayush jha


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.