Square It UpProblem code: AD5 |
All submissions for this problem are available.
A square piece of paper with integer dimensions NxN is placed with a corner at the origin and two of its sides along the x- and y-axes. Then, we cut it up respecting the following rules:
1.We only make straight cuts between two points lying on different sides of the square, and having integer coordinates.
2.Two cuts cannot cross, but several cuts can meet at the same border point.
3.Proceed until no more legal cuts can be made.
Counting any reflections or rotations as distinct, we call C(N) the number of ways to cut an NxN square.
Input
First line contains the number of test cases t(1<=t<=1000) and followed by t lines which contain various values of n(1<=n<=330).
Output
For each value of n, print value of C(n) MOD (10^8)
Example
Input: 2 1 2 Output: 2 30 Explanation For n=2, answer is![]()
| Author: | killer17 |
| Date Added: | 28-02-2010 |
| Time Limit: | 2 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions
