Two groups
Practice
0 (0 votes)
Open
Open
Open
Math basic
Basic math
Easy
Mathematics
Math
Problem
78% Success 303 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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 \(10^{9}+7\).

Input format

  • First line: \(T\) denoting the number of test cases
  • Next \(T\) lines: \(N\) denoting the number of people in a room

Output format

For each test case, print the number of ways as modulo \(10^{9}+7\) in a new line.

Constraints

\(1 \le T \le 10^{5}\)
\(1 \le N \le 10^{9}\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
17 votes
Tags:
Dynamic ProgrammingAlgorithmsEasy-MediumMathematicsOpenApprovedGame Theory
Points:20
111 votes
Tags:
Ad-HocApprovedEasyOpenString Manipulation
Points:30
6 votes
Tags:
ApprovedBinary SearchMathMediumOpenSorting