Modulo 6

View as PDF

Points: 250 (p) Time limit: 0.4s Memory limit: 256M Input: stdin Output: stdout

Cho hai số nguyên dương \(N\)\(K\). Hãy đếm số lượng số x trong khoảng \([1;+\infty]\)\(N\) \(mod\) \(x\) \(=K\) (hay \(N\) đồng dư với \(x\) theo modulo \(K\)).

Input

  • Một dòng duy nhất là hai số nguyên dương \(N, K\).

Output

  • Xuất ra 1 dòng duy nhất là đáp án của bài toán. Nếu số lượng số là vô hạn thì xuất oo.

Constraints

  • \(1\leq N,K\leq 10^{12}\)

Example

Test 1

Input
10 4 
Output
1
Note
  • Chỉ có một giá trị \(x\) duy nhất là \(6\) (\(10\) \(mod\) \(6=4\))

Comments

There are no comments at the moment.