Two Groups

3.6

15 votes
Mathematics, Easy, Mathematics, Mathematics, Mathamatics
Problem

There are N people in a room.
Your task is to find the number of ways to divide the people of the room into two groups A and B, such that each group contains at-least one member.
As the number of ways can be large, print output modulo 109+7.

Input format

  • First line contains the number of test cases, T.
  • Next T lines contains N denoting the number of people in a room.

Output format

For each test case, print the number of ways as modulo 109+7 in a new line.

Constraints

1T105
1N109

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

In case 1 : There are 2 people in room , so there are two ways i.e

a) Group1 : 1st Person , Group 2 : 2nd Person

b) Group1 : 2nd Person , Group 2 : 1st Person

Editor Image

?