SCU 2008 warmup contest 3

H: Binary Tree