#P6286. 2018

    ID: 5154 远端评测题 1000ms 32MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>CCPC2018-湖南全国邀请赛-重现赛(感谢湘潭大学)

2018

Problem Description

Given $a, b, c, d$, find out the number of pairs of integers $(x, y)$ where $a \leq x \leq b, c \leq y \leq d$ and $x \cdot y$ is a multiple of $2018$.

Input

The input consists of several test cases and is terminated by end-of-file.

Each test case contains four integers $a, b, c, d$.

Output

For each test case, print an integer which denotes the result.

## Constraint

* $1 \leq a \leq b \leq 10^9, 1 \leq c \leq d \leq 10^9$
* The number of tests cases does not exceed $10^4$.

1 2 1 2018 1 2018 1 2018 1 1000000000 1 1000000000
3 6051 1485883320325200