A binary tree of warehouse-bin item counts is given in level-order form (a single line of space-separated tokens, null marking a missing child; every non-null node contributes exactly two following tokens for its children).
For every depth level of the tree (the root is level 0), compute the sum of the values of all nodes at that level. Print the single largest such level-sum.
Input format
Line 1: space-separated level-order tokens describing the binary tree (integers and the token null).
Output format
A single integer: the maximum sum of node values found at any one level. If the tree is empty, print 0.
Constraints
- 0 <= number of nodes <= 1000
- Each node value is an integer with -1000 <= value <= 1000