F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

2018

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3451    Accepted Submission(s): 1605


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$.
 

Sample Input
1 2 1 2018 1 2018 1 2018 1 1000000000 1 1000000000
 

Sample Output
3 6051 1485883320325200
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 11:14:00, Gzip enabled