PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000222. Đếm cặp sau khi chia cả hai số (Divide Both)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm cặp sau khi chia cả hai số (Divide Both)

Divide Both

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Given L,RL,R, count ordered pairs (x,y)(x,y) with L≤x,y≤RL\le x,y\le R. Let g=gcd⁡(x,y)g=\gcd(x,y). A pair qualifies iff g>1g>1, x/g>1x/g>1 and y/g>1y/g>1. The order matters: (x,y)(x,y) and (y,x)(y,x) are distinct when x≠yx\ne y. Exclude pairs in which one number divides the other.

Input

One line containing L,RL,R.

Output

Print the number of valid ordered pairs.

Subtasks

  • Subtask 1 (20 points): 1≤L≤R≤501\le L\le R\le 50.

  • Subtask 2 (30 points): 1≤L≤R≤100001\le L\le R\le 10000.

  • Subtask 3 (50 points): 1≤L≤R≤10000001\le L\le R\le 1000000.

Examples

Example 1

Input

3 7

Output

2

Explanation

Exactly the two ordered pairs (4,6) and (6,4) qualify: their GCD is 2, and dividing both numbers by 2 yields 2 and 3.

Example 2

Input

4 10

Output

12

Explanation

Count ordered pairs with GCD greater than 1, then remove pairs in which either number divides the other. The answer is 12.