Subtree Sum
https://cses.fi/problemset/task/1137/Input Format
.Output Format
.Question Video
.Sample Input
5 3Sample Output
4 2 5 2 1
1 2
1 3
3 4
3 5
2 3
1 5 3
2 3
8
10
-
Asked in Companies
-
Related Topics
Video Solution
Code Solution
{ }
{ }
Run