Codeforces Beta Round #56 Problem C Mushroom Strife