BETA

Difficulty Level: Easy

Submissions: 310 Accuracy:

21.94%

Ways to write n as sum
     

For a given number n > 0, find the number of different ways in which n can be written as a sum of at two or more positive integers.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains the integer N. 

Output:
Output the number of ways N can be written as the sum of two or more positive integers for each test case in a new line. Since the answer can be quite large print the answer modulo 109+7.

Constraints:
1<= T <=100
1<= N <=1000

Example:
Input:
2
5
3
Output:
6
2

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Sujnesh Mishra

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.