Divide and Rule
It's the first day of Sushil at high school. Every class in his school has a class teacher. Since every year some mischievous students come to school, class teacher elects one class representative who in the absence of main teacher handles the mischievous students and maintain the discipline of the class. Sushil is very enthusiastic about the post of class
representative and wants to become the next one.
But this is not easy. There is someone else who wants to give him a competition. So now there are two competitor for the post of class representative and to choose one among them class teacher gave the
following problem to both of them. Class teacher wants them to solve it in order to become the class representative.
The problem is as follows:
"There are N different students in the class. Find the number of ways in which you can pick even and odd number of students."
As the problem is tough for high school level teacher gave them the time of one day and they can submit the solution next day. Sushil came to you as you are a good friend of Sushil for help. Help Sushil to find the answer to problem the teach gave.
First line of input contain T, the number of test cases. Then next T lines consists of N, number of students in the class.
For every line of input N, print the number of desired ways to choose even and odd students respectively, separated by space(" ") modulo 1000000007(10⁹+7).
- 1 ≤ T ≤ 10⁵
- 0 ≤ N ≤ 10¹⁸
For N = 2 , suppose students are S1 and S2. So we can either choose Student S1 or S2 or both S1 and S2. So there are three cases out of which 1 has even students and 2 have odd students.
Note - Do not count the empty case.
|Tags||combinatorics, himkha_100, maths, nplq2019|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions