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

#GL0000180. Kiểm tra chia hết cho giai thừa (Factovisors)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Kiểm tra chia hết cho giai thừa (Factovisors)

Factovisors

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given two nonnegative integers nn and mm, define the factorial by

0!=1,n!=1⋅2⋯n(n≥1).0!=1,\qquad n!=1\cdot2\cdots n\quad(n\ge1).

Determine whether mm divides n!n!, meaning that an integer qq exists such that n!=mqn!=mq.

In particular, 00 does not divide any factorial, while 11 divides every factorial, including 0!=10!=1.

Print the conclusion using exactly one of the two formats specified below.

Input

One line containing two nonnegative integers nn and mm.

Output

If m∣n!m\mid n!, print exactly <m> divides <n>!; otherwise print <m> does not divide <n>!. Replace <m> and <n> with their numeric values.

Subtasks

  • Subtask 1 (20 points): 0≤n,m≤300 \le n,m \le 30.
  • Subtask 2 (30 points): 0≤n,m≤1060 \le n,m \le 10^6.
  • Subtask 3 (50 points): 0≤n,m<2310 \le n,m < 2^{31}.

Examples

Example 1

Input

6 9

Output

9 divides 6!

Explanation

6!=720=9⋅806!=720=9\cdot80, so 99 divides 6!6! and the first output format applies.

Example 2

Input

6 27

Output

27 does not divide 6!

Explanation

6!=7206!=720 leaves remainder 1818 upon division by 2727, so the second output format applies.