1066 - [Data Structure] Tree Scoreboard

Time

2016/11/23 18:30:00 2016/11/23 19:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11208 MaxPath

11208 - MaxPath   

Description

Input a complete binary tree where each node has an non-negative weight value w, which is called node weight. Path weight is defined as the summation of node weights in a root-to-leaf path. Please calculate the maximum path weight in the tree.

Input

There are lots of complete binary trees in the input. Each tree occupies a line. Tree height is smaller than 10.

Output

For each tree, output the maximum path weight in a line.

Sample Input  Download

Sample Output  Download

Tags




Discuss