GO Solution For UVa 10088 - Trees on My Island. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

Figure: A sample of my island

I have bought an island where I want to plant trees in rows and columns. So, the trees will form a rectangular grid and each of them can be thought of having integer coordinates by taking a suitable grid point as the origin.

But, the problem is that the island itself

...

You can find the full details of the problem Trees on My Island at UVa Online Judge

Sample Input

12
3 1
6 3
9 2
8 4
9 6
9 9
8 9
6 5
5 8
4 4
3 5
1 3
12
1000 1000
2000 1000
4000 2000
6000 1000
8000 3000
8000 8000
7000 8000
5000 4000
4000 5000
3000 4000
3000 5000
1000 3000
0

Sample Output

21
25990001

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

Solution originally posted at: Github by @codingsince1985