← Home
For problem statement at 0-999/300-399/350-359/353/problemA.txt this is a correct solution, but verifier at 0-999/300-399/350-359/353/verifierA.go ends with All tests passed can you fix the verifier? ```go
package main

import "fmt"

func main() {
	var n int
	if _, err := fmt.Scan(&n); err != nil {
		return
	}

	sumTop, sumBot := 0, 0
	canSwap := false

	for i := 0; i < n; i++ {
		var x, y int
		fmt.Scan(&x, &y)
		sumTop += x
		sumBot += y
		if (x%2) != (y%2) {
			canSwap = true
		}
	}

	if sumTop%2 == 0 && sumBot%2 == 0 {
		fmt.Println(0)
	} else if sumTop%2 != 0 && sumBot%2 != 0 && canSwap {
		fmt.Println(1)
	} else {
		fmt.Println(-1)
	}
}
```