def f(n): if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 d = [0 for i in range(n + 1)] d[0] = 1 d[1] = 0 d[2] = 1 for i in range(3, n + 1): d[i] = (i - 1) * (d[i - 1] + d[i - 2]) print(d) return d[n] n = int(inpu...