← Home
For problem statement at 1000-1999/1900-1999/1980-1989/1985/problemE.txt this is a correct solution, but verifier at 1000-1999/1900-1999/1980-1989/1985/verifierE.go ends with All tests passed can you fix the verifier? package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReaderSize(os.Stdin, 1<<20)
	var out bytes.Buffer

	var t int
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		var x, y, z, k int64
		fmt.Fscan(in, &x, &y, &z, &k)

		var ans int64
		for a := int64(1); a <= x; a++ {
			if k%a != 0 {
				continue
			}
			rem := k / a
			for b := int64(1); b <= y; b++ {
				if rem%b != 0 {
					continue
				}
				c := rem / b
				if c <= z {
					cur := (x - a + 1) * (y - b + 1) * (z - c + 1)
					if cur > ans {
						ans = cur
					}
				}
			}
		}

		fmt.Fprintln(&out, ans)
	}

	os.Stdout.Write(out.Bytes())
}