parent and pathSum of size n x 35 (since 10^10 < 2^35).parent and pathSum with the immediate receiver and their ID, respectively.parent and pathSum tables using the values from the previous power of 2.res to store the maximum sum of IDs.i, calculate the sum of IDs for k passes using the parent and pathSum tables and update res if the sum is greater.res.