题目描述
Roxy M. Greyrat is your data structures and algorithms teacher. Recently, she created a new data structure called Roxy tree.
Roxy Tree has one root node, and the root node has 2 children. So there are 2 nodes on the second layer.
But then the amount of the children of the nodes on the second layer is 3, and then the amount of the children of the nodes on the third layer is back to 2, do 2-3-loop, and so on.
Formally, the amount of the children of the nodes on the i-th layer is 2 if i is odd, and is 3 if i is even.
For example, a Roxy tree (or maybe called binary-ternary tree?):
You can see some numbers near the nodes, they are indexes of the nodes.
The Problem is, I will give you some of indexes of the nodes, you should tell me they are which one on which layer.
Since this is the first problem, I will give you a friendly tip. This problem uses ACM input-output formats. You can get an aid from this page: 帮助 - AHUCM Online Judge. Good luck!
输入
Several lines of indexes Ii.
输出
Corresponding i and j for each line of input. They are means that this node is the j-th one on the i-th layer. i and j are indexed from 1.
提示
Values' range:
0 <= Ii <= 1017