For problem statement at 0-999/300-399/340-349/342/problemA.txt this is a correct solution, but verifier at 0-999/300-399/340-349/342/verifierA.go ends with All tests passed can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
)
func main() {
in := bufio.NewReader(os.Stdin)
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
var n int
if _, err := fmt.Fscan(in, &n); err != nil {
return
}
f := make([]int, 8)
for i := 0; i < n; i++ {
var x int
fmt.Fscan(in, &x)
if x >= 0 && x < 8 {
f[x]++
}
}
if f[5] > 0 || f[7] > 0 {
fmt.Fprintln(out, -1)
return
}
x := f[4]
z := f[3]
y := f[2] - x
if y < 0 || f[6] != y+z || f[1] != x+y+z {
fmt.Fprintln(out, -1)
return
}
for i := 0; i < x; i++ {
fmt.Fprintln(out, "1 2 4")
}
for i := 0; i < y; i++ {
fmt.Fprintln(out, "1 2 6")
}
for i := 0; i < z; i++ {
fmt.Fprintln(out, "1 3 6")
}
}