← Home
```go
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	hillocks := make([][2]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&hillocks[i][0], &hillocks[i][1])
	}

	// For each species (1-10), do BFS/DFS to find reachable hillocks
	// A frog of species i can jump exactly i units along X or Y axis
	// meaning from (x,y) it can reach (x+i, y), (x-i, y), (x, y+i), (x, y-i)
	// if that point is a hillock

	// Build a set of hillock coordinates
	hillock_set := make(map[[2]int]bool)
	for _, h := range hillocks {
		hillock_set[[2]int{h[0], h[1]}] = true
	}

	maxDist := 0

	for species := 1; species <= 10; species++ {
		// BFS from (0,0)
		visited := make(map[[2]int]bool)
		queue := [][2]int{{0, 0}}
		visited[[2]int{0, 0}] = true

		for len(queue) > 0 {
			curr := queue[0]
			queue = queue[1:]

			// Try 4 directions
			directions := [][2]int{
				{curr[0] + species, curr[1]},
				{curr[0] - species, curr[1]},
				{curr[0], curr[1] + species},
				{curr[0], curr[1] - species},
			}

			for _, next := range directions {
				if visited[next] {
					continue
				}
				// Check if next is a hillock (or origin)
				if next[0] == 0 && next[1] == 0 {
					visited[next] = true
					queue = append(queue, next)
					continue
				}
				if hillock_set[next] {
					visited[next] = true
					dist := next[0]
					if dist < 0 {
						dist = -dist
					}
					dy := next[1]
					if dy < 0 {
						dy = -dy
					}
					manhattan := dist + dy
					if manhattan > maxDist {
						maxDist = manhattan
					}
					queue = append(queue, next)
				}
			}
		}
	}

	fmt.Println(maxDist)
}
```