Discussion About Tree - Find sum

This is Discussion thread about Tree - Find sum

Hey what is wrong in the code i am not able to get it?
This is the problem: https://hack.codingblocks.com/app/practice/2/p/140
My code: https://ide.codingblocks.com/s/143032

On submission it is showing wrong ans

https://hack.codingblocks.com/app/practice/2/p/140
In given test case case author has not taken into account about integer overflow and calculated some for int.
If you take long long int into account you will get the right ans.
Thank you.

Can Anyone Help me how i am getting all cases wrong!
My Code : https://ide.codingblocks.com/s/226798

https://hack.codingblocks.com/app/practice/2/276/problem
i am geeting 2 wrong case

use long data type instead of int then your rest two cases will be resolved as int can not fit the maximum value which is required