GO Solution For UVa 10022 - Delta-wave. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

On the triangular field shown on the picture, small triangles are num- bered from 1 to oo (infinity). Traveller wants to go from triangle M to triangle N . Traveller can move only through the sides of triangles, not vertices. The number of sides he crosses is called the path length.

You are to dete


You can find the full details of the problem Delta-wave at UVa Online Judge

Sample Input


6 12

Sample Output


Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985