TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Working in a boutique folding and putting in order T-shirts according to their sizes seems very easy. But is it really so simple?

Given n objects of different sizes, how many different arrangements can be done using relationships "<" and "="?

For instance, with 2 objects, A and B, we have 3 possible arrangements:

A=B     A<B     B<A

With 3 objects, A, B and C, you must conclude that 13 different arrangements exist:

A=B=C     A=B<C     A<B=C     A<B<C     A<C<B     A=C<B     B<A=C     B<A<C    
B<C<A     B=C<A     C<A=B     C<A<B     C<B<A

Input Format

The first line of the input contains an integer, t, indicating the number of test cases. For each test case, one line appears, that contains a number n, representing the number of objects.

t<= 1000
1<=n<=1000

Output Format

For each test case, the output should contain a single line with the number representing the different arrangements you can do with n objects. The result can be very large, print the result modulo 10056.

Sample Input 1

3
1
2
3

Sample Output 1

1
3
13

Hints

Problem Source

Migrated from old NTUJ.

uva 12034

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1000 65536 200