codeforces; solve "Epic Game" from Beta Round #90