All submissions for this problem are available.
"...a composition of a positive integer n is a way of writing n as a sum of strictly positive integers. Two sums which differ in the order of their summands are deemed to be different compositions, while they would be considered to be the same partition."
- Quote from Wikipedia
How many compositions of a number n are with summands either 1 or 2.
The first line contains a number, the number of test cases (<= 1000000). Each subsequent line contains a number n (<= 1000000000).
For test case print the solution mod 1000000007 on a new line.
Input: 3 2 4 6 Output: 1 3 8
|Time Limit:||1.30846 - 3.24 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, COB, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, kotlin, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, rust, SCALA, SCM chicken, SCM guile, SCM qobi, ST, swift, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.