CardWars Contest Problem