B - tcaF
解説
/


実行時間制限: 2 sec / メモリ制限: 1024 MiB
配点 : 150 点
問題文
2 以上の整数 X が与えられます。
N!=X を満たすような正の整数 N を求めてください。
ただし、N! は N の階乗を表し、そのような N がただ一つ存在することは保証されています。
制約
- 2 \leq X \leq 3 \times 10^{18}
- N!=X を満たすような正の整数 N がただ一つ存在する
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
X
出力
答えを出力せよ。
入力例 1
6
出力例 1
3
3!=3\times2\times1=6 より、3 を出力します。
入力例 2
2432902008176640000
出力例 2
20
20!=2432902008176640000 より、20 を出力します。
Score : 150 points
Problem Statement
You are given an integer X not less than 2.
Find the positive integer N such that N! = X.
Here, N! denotes the factorial of N, and it is guaranteed that there is exactly one such N.
Constraints
- 2 \leq X \leq 3 \times 10^{18}
- There is exactly one positive integer N such that N!=X.
- All input values are integers.
Input
The input is given from Standard Input in the following format:
X
Output
Print the answer.
Sample Input 1
6
Sample Output 1
3
From 3!=3\times2\times1=6, print 3.
Sample Input 2
2432902008176640000
Sample Output 2
20
From 20!=2432902008176640000, print 20.