Factorial Factors
시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2016-17 openBOJ 30004
문제
For any positive integer , define as the smallest positive integer , whose factorial\footnote{The factorial of a positive integer (denoted as ) is the product of all integers from 1 to : is divisible by .
For example, $\begin{align*} s(1) &= 1,\\ s(2) &= 2,\quad \text{(because 1!2! (=2) is)}\\ s(4) &= 4,\quad \text{(3!4! (=24) is)}\\ s(6) &= 3,\quad \text{(3! (=6) is divisible by 6)}\\ s(9) &= 6,\quad \text{(6! (=720) is divisible by 9)}\\ s(10) &= 5,\quad \text{etc}\\ \end{align*}$
The task is, given two integers and , to find the sum:
입력
The single line of input contains two space-separated integers: and ().
출력
The first and only line of output should contain the required sum.
예제
예제 1
입력
5 10
출력
30
코드를 제출하려면 로그인하세요.