Problem1535--2017

1535: 2017

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

Given a,b,c,d, find out the number of pairs of integers (x,y) where a ≤ x ≤ b,c ≤ y ≤ d and x·y is multiple of 2017.

Input

The input contains zero or more test cases and is terminated by end-of-file. Each test case contains four integers a,b,c,d. • 1≤ a ≤ b ≤10^9,1≤ c ≤ d ≤10^9 • The number of tests cases does not exceed 10^4.

Output

For each case, output an integer which denotes the result.

Sample Input Copy

1 2017 1 2016 
1 1000000000 1 1000000000

Sample Output Copy

2016
991324197233775

Source/Category