← Home
For problem statement at 1000-1999/1700-1799/1790-1799/1790/problemE.txt this is a correct solution, but verifier at 1000-1999/1700-1799/1790-1799/1790/verifierE.go ends with All 60 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 t int
	if _, err := fmt.Fscan(in, &t); err != nil {
		return
	}

	for i := 0; i < t; i++ {
		var x int
		fmt.Fscan(in, &x)
		if x%2 != 0 || (x&(x>>1)) != 0 {
			fmt.Fprintln(out, -1)
		} else {
			a := x >> 1
			b := x + a
			fmt.Fprintln(out, a, b)
		}
	}
}