← Home
For problem statement at 1000-1999/1900-1999/1960-1969/1968/problemE.txt this is a correct solution, but verifier at 1000-1999/1900-1999/1960-1969/1968/verifierE.go ends with case 1 failed
expected:
1 1
1 2
3 3
got:
2 1
2 3
3 1
input:
1
3
exit status 1 can you fix the verifier? ```go
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	for i := 0; i < t; i++ {
		scanner.Scan()
		n, _ := strconv.Atoi(scanner.Text())
		points := solve(n)
		for _, p := range points {
			fmt.Fprintf(out, "%d %d\n", p[0], p[1])
		}
	}
}

func solve(n int) [][2]int {
	switch n {
	case 2:
		return [][2]int{{1, 1}, {1, 2}}
	case 3:
		return [][2]int{{2, 1}, {2, 3}, {3, 1}}
	case 4:
		return [][2]int{{1, 1}, {3, 1}, {4, 3}, {4, 4}}
	case 5:
		return [][2]int{{1, 1}, {2, 1}, {4, 1}, {5, 4}, {5, 5}}
	}

	points := make([][2]int, 0, n)
	points = append(points, [2]int{1, 1})
	points = append(points, [2]int{2, 1})

	if n%2 == 0 {
		for x := 4; x <= n; x += 2 {
			points = append(points, [2]int{x, 1})
		}
		for y := 5; y <= n-1; y += 2 {
			points = append(points, [2]int{n, y})
		}
		points = append(points, [2]int{n, n})
	} else {
		for x := 4; x <= n-1; x += 2 {
			points = append(points, [2]int{x, 1})
		}
		points = append(points, [2]int{n, 1})
		for y := 6; y <= n-1; y += 2 {
			points = append(points, [2]int{n, y})
		}
		points = append(points, [2]int{n, n})
	}
	return points
}
```