409793: GYM103743 J Balanced Tree
Memory Limit:64 MB
Time Limit:0 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
J. Balanced Treetime limit per test1.5 smemory limit per test64 megabytesinputstandard inputoutputstandard output
A binary tree $$$T$$$ is called super balanced if $$$T$$$ is empty or satisfies the following three conditions at the same time:
- The left subtree of $$$T$$$ is super balanced.
- The right subtree of $$$T$$$ is super balanced.
- The number of nodes of the left subtree and the right subtree differs at most $$$1$$$.
Please calculate the number of super balanced trees consisting of $$$n$$$ nodes. Since the answer can be very large, just output the answer modulo $$$2^{64}$$$.
InputThe first line contains a single integer $$$T$$$ ($$$1\le T\le 10^6$$$), indicating the number of test cases.
Each test case contains a single integer $$$n$$$ ($$$0 \le n < 2 ^{64}$$$), indicating the number of nodes in the tree.
OutputFor each test case, output an integer in a single line indicating the number of super balanced trees consisting of $$$n$$$ nodes.
ExampleInput2 2 3Output
2 1