Submit | All submissions | Best solutions | Back to list |
HLP_RAMS - Topper Rama Rao |
Rama Rao is the topper of his branch. One of his friends was jealous of it. So, he poses a question to test Rama Rao and is as follows:
For a given n, find the number of even and odd numbers among the set, { nC0, nC1 ... nCn }.
Rama Rao was having hard time solving it. He hopes you can help him.
Input
First line contains t (1 <= t <= 105), the number of test cases. Next t lines contain one integer per line, denoting n (0 <= n <= 1012).
Output
For each test case, output two space separated integers specifying the number of even numbers and odd numbers respectively.
Example
Input: 2 3 4 Output: 0 4 3 2
Explanation:
for 3, values are: 1 3 3 1. All are odd. Hence 0 4.
for 4, values are: 1 4 6 4 1. Hence 3 2.
Added by: | nitish rao |
Date: | 2014-03-06 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | My own Problem |
hide comments
|
||||||
2015-08-30 12:31:02
TLE ! BITwise operators to the rescue => AC ! :) |
||||||
2015-08-02 18:23:04
the above pattern is forming PASCAL'S TRIANGLE... |
||||||
2015-07-25 19:24:17
learnt a new thing.. Last edit: 2015-07-25 19:30:33 |
||||||
2015-07-08 07:42:07 chin
learnt a new thing!!!....:D |
||||||
2015-06-02 09:46:31 Aman Agarwal
nice problem helped to learn a new thing |
||||||
2015-05-26 20:36:30 ASHUTOSH DWIVEDI
learnt about new thing but easy one to get 0.2 points............AC in one go :))) |
||||||
2015-03-20 17:11:09 Bala Vignesh [Inactive]
sweet! Last edit: 2015-03-20 17:11:45 |
||||||
2015-02-24 19:37:50 Dushyant Singh
What's the output for n=0? re(vamsi): It is clear what the output is. Just follow the given instructions. Last edit: 2015-02-25 17:01:31 |
||||||
2015-01-04 15:21:43 Sahil Sharma
Hey, what does golfing version mean? Thanks Last edit: 2015-01-04 15:21:57 |