For problem statement at 0-999/400-499/430-439/432/problemE.txt this is a correct solution, but verifier at 0-999/400-499/430-439/432/verifierE.go ends with All tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
)
func nextColor(top, left byte) byte {
for c := byte('A'); c <= 'Z'; c++ {
if c != top && c != left {
return c
}
}
return 'A'
}
func main() {
in := bufio.NewReader(os.Stdin)
var n, m int
fmt.Fscan(in, &n, &m)
ans := make([][]byte, n)
for i := range ans {
ans[i] = make([]byte, m)
}
r, c := 0, 0
h, w := n, m
var top, left byte
for {
col := nextColor(top, left)
s := h
if w < s {
s = w
}
for i := 0; i < s; i++ {
for j := 0; j < s; j++ {
ans[r+i][c+j] = col
}
}
if h == w {
break
}
if h < w {
c += s
w -= s
left = col
} else {
r += s
h -= s
top = col
}
}
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
for i := 0; i < n; i++ {
out.Write(ans[i])
if i+1 < n {
out.WriteByte('\n')
}
}
}