Each of the N balls has a corresponding size, and small balls can be nested inside large balls. A ball can only nest one small ball, but it can be nested recursively. Now you can make $1$ balls of size $X$ into $2$ balls of size $X-1$. It is required that when there is no way to nest in the end, the size of each ball is the same. Ask how many operations are required at least.
The final situation achieved is that the largest number of balls is the largest.
Start enumerating from the current largest number of balls to see how many operations are needed. Then change the largest ball into two second largest balls, and then enumerate the number of operations required for the current number.
Later, I asked others and found that dp[i][k] can represent the number of options in which the sum of the first i digits is k and the XOR is 0. The inside is transferred through the combination number.