#K88982. Cookie Arrangements
Cookie Arrangements
Cookie Arrangements
You are given T test cases. In each test case, you are given a single positive integer n which represents the number of cookies. Your task is to determine the number of valid arrangements of cookies. The number of valid arrangements is defined as n! (n factorial) computed modulo \(10^9+7\).
Formally, for each test case, compute:
\(\text{result} = n! \mod (10^9+7)\)
For example, if n = 3, then the valid arrangements = 6; if n = 5, then the valid arrangements = 120.
inputFormat
The first line of input contains a single integer T, denoting the number of test cases.
The second line contains exactly T space-separated integers, where the ith integer represents the number of cookies in the ith test case.
outputFormat
For each test case, output a single line containing the number of valid cookie arrangements modulo \(10^9+7\>.
## sample3
2 3 4
2
6
24
</p>