The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
A city of dimension N x N is constructed with grid of lanes. These lanes are fenced by government so that no one can cross any grid diagonally. Although a train
Â
line runs diagonally from (0,0) to (N,N).
Â
Our chef has a weird kind of phobia and is very afraid to cross the railway line. He is at point (0,0) and wants to get to the point (N,N). Calculate number of path
Â
through which it is possible to reach to its destination travelling the minimum distance. .
Â
Note that:
Â
1. Since he is already at position (0,0) he can go to either part of grid (i.e. left or right part - divided by diagonal) but he will remain in that part for the whole path.
Â
2. He is only afraid to "cross" the line, i.e. during the route he can go to position (m,m) where 0
3. You have to calculate the number of path possible. If there is more than one path then you have to print the number of path of minimum distances.
Â
Â
The first line of the input contains an integer T denoting the number of test cases, for each test case enter the grid size i.e value of N.
Â
Â
For each test case, output a single line with number of such paths possible.
Â
(Note : If no such path possible print 0)
Â
Â
Â
Input: 2 2 5 Output: 4 84
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll