SPLITNUM - Split the number
Given a natural number n, in how many ways can you split the number into sum of two or more natural numbers ? For eg, 4 can be split in 4 ways :
- 1 + 1 + 1 + 1
- 1 + 2 + 1
- 2 + 2
- 1 + 3
Input
First line consists of t, the number of test cases.
Each of the t lines consists of n (1<=n<=1000)
Output
Output t lines each containing the corresponding number of ways the number can be split. Since this answer can be large, print the answer modulo 1000000007.
Example
Input: 2
3
4
Output: 2
4
hide comments
Min_25:
2014-11-06 04:33:49
@Pandian
|
|
Pandian:
2014-11-05 17:03:06
@Min_25 :
|
|
Min_25:
2014-11-05 15:22:12
@Pandian
|
|
Robert Gerbicz:
2013-10-20 11:33:47
Almost the same partition number problem:http://www.spoj.com/problems/PARCARD1/ Moved to tutorial. |
Added by: | Pandian |
Date: | 2013-10-15 |
Time limit: | 0.5s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own |