For problem statement at 0-999/700-799/740-749/749/problemB.txt this is a correct solution, but verifier at 0-999/700-799/740-749/749/verifierB.go ends with case 4 failed: expected 3
-24 23
4 13
-8 3 got 3
-24 23
-8 3
4 13
input:
-16 13 -10 18 -2 8
exit status 1 can you fix the verifier? package main
import (
"bufio"
"fmt"
"os"
"sort"
)
type Point struct {
x, y int
}
func main() {
in := bufio.NewReader(os.Stdin)
p := make([]Point, 3)
for i := 0; i < 3; i++ {
fmt.Fscan(in, &p[i].x, &p[i].y)
}
ans := []Point{
{p[0].x + p[1].x - p[2].x, p[0].y + p[1].y - p[2].y},
{p[0].x + p[2].x - p[1].x, p[0].y + p[2].y - p[1].y},
{p[1].x + p[2].x - p[0].x, p[1].y + p[2].y - p[0].y},
}
sort.Slice(ans, func(i, j int) bool {
if ans[i].x != ans[j].x {
return ans[i].x < ans[j].x
}
return ans[i].y < ans[j].y
})
out := bufio.NewWriter(os.Stdout)
defer out.Flush()
fmt.Fprintln(out, 3)
for _, pt := range ans {
fmt.Fprintln(out, pt.x, pt.y)
}
}