Stacking PancakesProblem code: PANSTACK |
All submissions for this problem are available.
Chef is good at making pancakes. Generally he gets requests to serve N pancakes at once. He serves them in the form of a stack. A pancake can be treated as a circular disk with some radius.
Chef needs to take care that when he places a pancake on the top of the stack the radius of the pancake should not exceed the radius of the largest pancake in the stack by more than 1. Additionally all radii should be positive integers, and the bottom most pancake should have its radius asĀ 1. Chef wants you to find out in how many ways can he create a stack containing N pancakes.
Input
First line of the input contains T (T <= 1000) denoting the number of test cases.
T lines follow each containing a single integer N (1 <= N <= 1000) denoting the size of the required stack.
Output
For each case the output should be a single integer representing the number of ways a stack of size N can be created. As the answer can be large print it modulo 1000000007.
Example
Input
2 1 2
Output
1 2
| Author: | kaushik_iska |
| Tester: | laycurse |
| Editorial | http://discuss.codechef.com/problems/PANSTACK |
| Date Added: | 1-03-2012 |
| Time Limit: | 1 sec |
| Source Limit: | 5000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS
Fetching successful submissions


Size of pancakes vary from 1
can anyone explain this
can anyone explain the test
what are the pancakes radii
the radii of the first
@migdal suppose the radii
@nitish712: In the case of
Please dont discuss
@Kaush_adm: Can you please
Can anybody explain the
whats answer for 3
While the problems here are
@Admin please provide non
the test cases given are of
Here is the explanation for
@Admin could you please give
admin gettin a wrong answer
@admin I tried using python,
@admin For N=6, 1 2 3 4 5 1
very nice problem..
My test are timing out
@mehankit7: Yes.
Good ques. :) Doing a very
@Kaush_adm "Chef needs to
i got runtime error.....which
@fox_3 because its given more
@admin python giving NZEC
in my pc its working but in
my code is running in good
Please, don't post any test
@kaush_adm: Sir, for n = 3,
@bilbo_dhawal: (1,3,2) is not
@poojits: ah yes ... stupid
this is TLE in O(n)?! are you
@admin- will you clarify what
I think abhisht7 has a point
in my pc its working but in
@admin pls provide some test
how funny, someone asking for
whats the output for n=5??
@assasin143: why you cannot
for n=5 (1,2,3,4,5)
is possible combinations are
wats d ans for n=1000 ??
Is answer for 1000 is
@vikram535 : yes thats wat i
@melwin_jose: me too :( Can
@vikram535: same here and
Can any one clear what is the
@include: i don't think
12345641 is a valid sequence
@ADMIN.."Can any one clear
@fox_3 : Valid
Codechef beginning to suck
for n=4 output is 14 is it
Can a smaller pancake be
@cupidvogel: the sample test
"when he places a pancake on
@truegff yeah
@satya_patel thanks,
@Satya Patel, My point,
@cupidvogel
What I've figured out is: one
khadarbasha n=14 answer is 15
@Admin: I think there is some
@all:those who r gettin wrong
Does Python on my laptop
getting wrong answer... my
@mohitgoel Check the this