Chef at GYM
All submissions for this problem are available.
So the Chef has become health conscious and is now lifting weights at the gym. But its his first time so the trainer gives him a simple job to do.
He has been given a weight lifting rod and N heavy weights, each weighing 20, 21, .... , 2n-1. He has to stick each of the "N" weights on the rod, one after another, in such a way that the right side is never heavier than the left side. At each step he chooses one of the weights that has not yet been fixed on the rod, and fix it on either the left side of the rod or the right, until all of the weights have been placed.
Now help the chef and find out, in how many ways the chef can accomplish this?
First line of input contains an integer T, the number of test cases. Then T test cases follow. Each line of test case contains one integer, N denoting the number of weights
The output contains T lines, each containing an integer denoting all possible combinations
Input: 3 2 5 18 Output: 3 945 221643095476699771875
|Time Limit:||0.1 sec|
|Source Limit:||5000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions