SCU 2008 warmup contest 3

B: Zeros and Ones