← Home
For problem statement at 1000-1999/1400-1499/1420-1429/1423/problemJ.txt this is a correct solution, but verifier at 1000-1999/1400-1499/1420-1429/1423/verifierJ.go ends with All tests passed can you fix the verifier? package main

import (
	"io"
	"os"
	"strconv"
)

const MOD uint64 = 1000000007

func nextUint64(data []byte, idx *int) uint64 {
	n := len(data)
	for *idx < n && data[*idx] <= ' ' {
		*idx++
	}
	var x uint64
	for *idx < n {
		c := data[*idx]
		if c <= ' ' {
			break
		}
		x = x*10 + uint64(c-'0')
		*idx++
	}
	return x
}

func main() {
	data, _ := io.ReadAll(os.Stdin)
	idx := 0
	t := int(nextUint64(data, &idx))
	out := make([]byte, 0, t*12)
	for i := 0; i < t; i++ {
		m := nextUint64(data, &idx)
		a := (m/4 + 1) % MOD
		b := ((m+2)/4 + 1) % MOD
		ans := (a * b) % MOD
		out = strconv.AppendUint(out, ans, 10)
		out = append(out, '\n')
	}
	os.Stdout.Write(out)
}