The problem has bug in it

Here are two approches to the problem

**approch 1**

for _ in range(int(input())):

n = int(input())

f = 1

for i in range(1, n + 1):

f *= i

print(f)

**approch 2:**

for _ in range(int(input())):

n = int(input())

f = n

for i in range(1, n):

f *= i

print(f)

but only approch1 is accepted