well u can read the problem statement here :
I did the same mentioned in editorial ( a little bit different to generalise for every value of k )
From editorial :
rootans = parentans * ( my size) / ( N - mysize )
so i just rerooted the tree and found the answer for children by induction what we usually do in DP on tree/rerooting
but the problem is i am getting only 10 points rest all of them are WA don’t know why
SUBMISSION LINK : CodeChef: Practical coding for everyone
can you help me to figure it out
i already devoted 3-4 hours but still not get out of it ( u can see my submission deadlines )
Expecting u for help