问题2481--2017

2481: 2017

时间限制: 1 Sec  内存限制: 128 MB
提交: 49  解决: 15
[提交] [状态] [讨论版] [命题人:]

题目描述

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.

输入

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≤109, 1≤ c ≤ d ≤109
• The number of tests cases does not exceed 104.

输出

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

样例输入

1 2017 1 2016
1 1000000000 1 1000000000

样例输出

2016
991324197233775

来源/分类


[提交] [状态]