时间限制: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 a multiple of 2018.
输入描述:
The input consists of several test cases and is terminated by end-of-file.
Each test case contains four integers a, b, c, d.
输出描述:
For each test case, print an integer which denotes the result.
示例1
输入
复制
1 2 1 2018
1 2018 1 2018
1 1000000000 1 1000000000
备注:
* 
* The number of tests cases does not exceed
.