WAYS - PATHS

Problem Statement:

Consider a square matrix of order m(m rows and m columns). At each step you can move one step to the right or one step to the top. How many possibilities are to reach (m,m) from (0,0)?

 

Input:

The first line consists of an integer t, the number of testcases.  Each testcase consists of a single integer m, the order of square matrix.

 

Output:

For each case print the number of possibilities of reaching the point (m,m) from (0,0)

 

Input Constraints:

1<=t<=10

1<=m<=14

 

Example:

Sample Input:

3

1

2

3

Sample Output:

2

6

20

 

Explanation of test case #2:

There are 6 possible ways of reaching (2,2) from (0,0)

See Also : WAYS (No source limit)

 


Added by:cegprakash
Date:2011-03-06
Time limit:0.100s
Source limit:120B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C C++ 4.3.2 CPP JAVA

hide comments
2012-10-28 02:06:11 (Tjandra Satria Gunawan)(曾毅昆)
stuck at 134B :( can't reduce my code...
Edit: Finally 119B :)

Last edit: 2012-06-27 18:34:34
2012-10-28 02:06:11 Aditya Pande
moreover in c i wud have to write return 0; else i would get nzec error

finally AC in c++ just using 103B
@D:- thnx for encouragement

edit: 97B

Last edit: 2012-12-14 16:04:30
2012-10-28 02:06:11 Aditya Pande
thanks


Last edit: 2013-01-09 04:17:35
2012-10-28 02:06:11 :D
The limit is tight but possible. Use C and you won't have to include anything.
2012-10-28 02:06:11 Aditya Pande
got it finally

Last edit: 2013-01-08 19:14:41
2012-10-28 02:06:11 cegprakash
79!! great
2012-10-28 02:06:11 teamjoseph1
How do you check the number of characters in the Source? Do u manually count the characters?
2012-10-28 02:06:11 albertg
Why we can't write on Pascal???
2012-10-28 02:06:11 apple
I've just rewritten the record to 81 characters in C :)


Last edit: 2011-07-06 12:03:17
2012-10-28 02:06:11 neophilic
Why is python not included?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.