UVa 112 - Tree Summing

112 - Tree Summing

 * UVA 112
 * PKU 1145
 * SWJTU 1420 (uses different input format, but same type of problem.)

Summary
Given a binary tree, determine if it is possible to traverse the tree to obtain a specific sum.

Input
22 (5(4(11(7)(2))) (8(13)(4(1)))) 20 (5(4(11(7)(2))) (8(13)(4(1)))) 10 (3     (2 (4   )        (8   ) )     (1 (6   )        (4   ) ) ) 5

Output
yes no yes no