Submit | All submissions | Best solutions | Back to list |
Problem hidden on 2014-03-25 22:27:53 by Francky
PAWAN1 - Pawan on date |
Pawan is going with her girlfriend on date (don't be happy :P concentrate on the question). So he wants to buy some gift for his girlfriend. He just goes to the shop and finds that there are n different gifts in the shop. He has infinite amount of money , so he can buy any number of gifts , but he will buy at least 1 gift for his girlfriend (otherwise she will be angry :P ) and he will never buy all the gifts (otherwise the shop would be empty :P ). Now Pawan wants to know the total number of ways of buying the gifts. Since the answer may be large , print it modulo (10^9 + 7).
Input
First line of input contains t (no. of test cases to follow). Next t lines contains n (number of gifts in the shop).
Output
Print t lines containing the answers for each case modulo (10^9 + 7).
Constraints
1<= t <= 1000
2<= n <= 10^18
Example
Input: 2
2
3 Output: 2
6
Explanation
for 2nd test case , there are 3 gifts in the shop. let those are A,B,C.
Pawan can buy the gifts in following 6 ways - A,B,C,AB,BC,AC.
He cannot buy 0 or all gifts.
Added by: | Man Mohan Mishra |
Date: | 2014-03-24 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | own problem |
hide comments
2014-05-15 08:35:11 ****
whats wrong in my submission : 11580852 ?? |
|
2014-04-01 18:14:30 [Lakshman]
@Mohit check this case 1000000006 and you will find the ans. |
|
2014-04-01 18:12:08 Maru
getting wrong WA.It's just a simple formula.Can't figure out why? Probably due to overflow! :\ |
|
2014-03-29 11:10:26 anurag garg
Last edit: 2014-03-29 11:10:45 |
|
2014-03-26 16:13:57 [Lakshman]
@anurag check this case 1000000006 |
|
2014-03-25 22:27:31 Francky
@Jacob : the psetter seems to be a fabulous solver regarding submissions... But you're right this problem don't belongs to classical, nor in tutorial as it is a nth duplicate. Problem hidden. |
|
2014-03-25 21:04:44 Jacob Plachta
This should probably be in Tutorial. |
|
2014-03-25 19:01:21 Pranay
isn't answer for n = 10^18 = 719476258 ? Pretty sure of the formula..can't get why WA ? ans(by author) --> formula is correct.Try to rethink over your code. Last edit: 2014-03-25 19:29:35 |
|
2014-03-25 18:30:16 Man Mohan Mishra
WA is not due to overflow. You are doing a small mistake. |
|
2014-03-25 18:12:47 anurag garg
whats wrong in my submission:11325603 is WA due to overflow... thanks edit-->is my formula correct or not..? ans (by author) --> formula is correct,just seriously check your code one more time. ---anurag-->since the problem is hidden now can you kindly tell me my mistake thanks Last edit: 2014-03-29 11:09:16 |