SCU 2008 warmup contest 2

C: E calculation