题解 | #整除问题#
整除问题
https://www.nowcoder.com/practice/8e29045de1c84d349b43fdb123ab586a
def fac(n): if n <= 2: return 2 return fac(n-1) * n def zhengchu(n, a): k = 0 n = fac(n) while n % a == 0: k += 1 n //= a return k while True: try: n, a = map(int, input().split()) res = zhengchu(n, a) print(res) except: break