Approach hintTry it first, then revealHide
The parent of vertex v is v / 2 with integer division, so the path sum satisfies a short recurrence that stops at the root. The values need 64-bit integers.
The parent of vertex v is v / 2 with integer division, so the path sum satisfies a short recurrence that stops at the root. The values need 64-bit integers.