My contribution to the CodinGame Ragnarok contest (2014-02-22)