Submit | All submissions | Best solutions | Back to list |
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
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 |
hide comments
2014-11-06 04:33:49 Min_25
@Pandian I confirmed that I/O files are corrected. Thank you for fixing them. However, previous solutions seem to be not rejudged. (Is that a SPOJ-related problem?) |
|
2014-11-05 17:03:06 Pandian
@Min_25 : IO files have been updated and all submissions are rejudged. |
|
2014-11-05 15:22:12 Min_25
@Pandian The constraint is not correct; Some n can be 1000 < n <= 10010. Please fix the I/O files and rejudge all submissions. --ans(Francky)--> Email sent to psetter. @Francky Thank you! Last edit: 2014-11-06 04:33:31 |
|
2013-10-20 11:33:47 Robert Gerbicz
Almost the same partition number problem:http://www.spoj.com/problems/PARCARD1/ Moved to tutorial. |