For problem statement at 1000-1999/1800-1899/1800-1809/1808/problemB.txt this is a correct solution, but verifier at 1000-1999/1800-1899/1800-1809/1808/verifierB.go ends with All tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func readInt(in *bufio.Reader) int {
n := 0
c, err := in.ReadByte()
for err == nil && c <= 32 {
c, err = in.ReadByte()
}
for err == nil && c > 32 {
n = n*10 + int(c-'0')
c, err = in.ReadByte()
}
return n
}
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
t := readInt(in)
for tc := 0; tc < t; tc++ {
n := readInt(in)
m := readInt(in)
cols := make([][]int64, m)
for j := 0; j < m; j++ {
cols[j] = make([]int64, n)
}
for i := 0; i < n; i++ {
for j := 0; j < m; j++ {
cols[j][i] = int64(readInt(in))
}
}
var ans int64
for j := 0; j < m; j++ {
sort.Slice(cols[j], func(x, y int) bool {
return cols[j][x] < cols[j][y]
})
for i := 0; i < n; i++ {
ans += cols[j][i] * int64(2*i-n+1)
}
}
fmt.Fprintln(out, ans)
}
}