Difficulty Level : Easy
Submissions : 17675
Asked In :
Marks :5
: 128 | : 36
Akash is naughty playboy. But today, he got selected for ATF Camp and he is a super happy soul.
There are exactly N days left before he will join ATF camp. Coincidently, he also has exactly N girlfriends. So, Akash plans to spend exactly one day with each of his girlfriends. You are jealous knowing about his plans, so to divert yourself, you focus on finding the number of ways Akash can plan his visits to his N girlfriends.
Example: Let's say Akash has to visit 3 girlfriends: A, B, C on 3 days. There are exactly 6 ways he can plan his trip:
Day 1 | Day 2 | Day 3 |
A | B | C |
A | C | B |
B | A | C |
B | C | A |
C | A | B |
C | B | A |
First Line: Integer T denoting number of test cases.
Each of Next T lines have one integer N, which denotes the number of days and the number of girlfriends Akash is planning to visit.
Constraints
1≤T≤10
1≤N≤10
For each test case, print the number of ways Akash can plan his trip as described in the problem statement.
The answer to each test case must be printed in a new line.
5 1 2 3 4 5
1 2 6 24 120
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.