1747.
Build a tree
时间限制 1000 ms
内存限制 512 MB
HazelFan wants to build a rooted tree. The tree has $n$ nodes labeled $0$ to $n-1$, and the father of the node labeled $i$ is the node labeled $\lfloor\frac{i-1}{k}\rfloor$. HazelFan wonders the size of every subtree, and you just need to tell him the XOR value of these answers.
输入数据
输出数据
For each test case:
A single line contains a nonnegative integer, denoting the answer.
样例输入
复制
2
5 2
5 3
\n
· \n
· \n