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

#GL0000215. Phép nhân và căn bậc hai (Math)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Phép nhân và căn bậc hai (Math)

Phép nhân và căn bậc hai (Math)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Starting with positive integer nn, you may: (1) replace nn by n⋅xn\cdot x for any positive integer xx; or (2) replace nn by its integer square root, only when the square root is an integer. Find the smallest attainable value, and the fewest operations necessary to reach it.

Input

One line contains nn.

Output

Print the minimum reachable value and the minimum number of operations required.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1001\le n\le 100.

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

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

Examples

Example 1

Input

20

Output

10 2

Explanation

Multiply 20 by 5 to reach 100, then take the integer square root to reach 10.

Example 2

Input

5184

Output

6 4

Explanation

5184 -> 72 -> 1296 -> 36 -> 6 uses four operations.

Example 3

Input

1

Output

1 0

Explanation

The number 1 already has its minimum value.