2017
题号:NC52851
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Given a, b, c, d, find out the number of pairs of integers (x, y) where and 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.
*
* The number of tests cases does not exceed .

输出描述:

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

输入

复制
1 2017 1 2016
1 1000000000 1 1000000000

输出

复制
2016
991324197233775