codeforce 804B Minimum number of steps

NoSuchKey