← Home
For problem statement at 0-999/600-699/610-619/615/problemC.txt this is a correct solution, but verifier at 0-999/600-699/610-619/615/verifierC.go ends with All tests passed can you fix the verifier? ```go
package main

import (
	"fmt"
)

func main() {
	var s, t string
	if _, err := fmt.Scan(&s, &t); err != nil {
		return
	}

	n := len(s)
	m := len(t)

	lcp_f := make([][]int16, m+1)
	lcp_b := make([][]int16, m+1)
	for i := 0; i <= m; i++ {
		lcp_f[i] = make([]int16, n+1)
		lcp_b[i] = make([]int16, n+1)
	}

	for i := m - 1; i >= 0; i-- {
		for j := n - 1; j >= 0; j-- {
			if t[i] == s[j] {
				lcp_f[i][j] = 1 + lcp_f[i+1][j+1]
			}
		}
		for j := 0; j < n; j++ {
			if t[i] == s[j] {
				if j > 0 {
					lcp_b[i][j] = 1 + lcp_b[i+1][j-1]
				} else {
					lcp_b[i][j] = 1
				}
			}
		}
	}

	type pair struct{ x, y int }
	var ans []pair

	i := 0
	for i < m {
		maxLen := int16(0)
		bestX, bestY := -1, -1
		for j := 0; j < n; j++ {
			if lcp_f[i][j] > maxLen {
				maxLen = lcp_f[i][j]
				bestX = j + 1
				bestY = j + int(maxLen)
			}
			if lcp_b[i][j] > maxLen {
				maxLen = lcp_b[i][j]
				bestX = j + 1
				bestY = j - int(maxLen) + 2
			}
		}
		if maxLen == 0 {
			fmt.Println("-1")
			return
		}
		ans = append(ans, pair{bestX, bestY})
		i += int(maxLen)
	}

	fmt.Println(len(ans))
	for _, p := range ans {
		fmt.Printf("%d %d\n", p.x, p.y)
	}
}
```