minimum knight moves spoj solution