John is attending a workshop for N days. He gets into trouble if he misses the workshop for two consecutive days.
Task
Determine the probability of him getting into trouble if he misses the workshop organized on the last day.
It can be shown that the probability can be represented as PQ where P and Q are coprime integers. Print the value of P*Q-1 modulo 109+7.
Note: There is an equal probability of John getting absent or present on any day.
Example
Assumption
Approach
Therefore the answer is 500000004.
Function description
Complete the absent function provided in the editor. This function takes the following parameter and returns the probability of John getting into trouble:
Input format
Note: This is the input format you must use to provide custom input (available above the Compile and Test button).
Output format
For each test case in a new line, print the required probability.
Constraints
1≤T≤1051≤N≤105
Code snippets (also called starter code/boilerplate code)
This question has code snippets for C, CPP, Java, and Python.
The first line denotes the number of test cases, T = 1.
The first test case
Given
Approach
Therefore the answer is 500000004.