Sergey Weiss's submission of Minimum Distance | CodeChef