← Home
For problem statement at 0-999/600-699/680-689/683/problemD.txt this is a correct solution, but verifier at 0-999/600-699/680-689/683/verifierD.go ends with all tests passed can you fix the verifier? package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var q int
	fmt.Fscan(in, &q)

	var out bytes.Buffer

	for i := 0; i < q; i++ {
		var n, m, p int
		fmt.Fscan(in, &n, &m, &p)

		ok := false
		if p <= n*m {
			for a := 1; a*a <= p; a++ {
				if p%a == 0 {
					b := p / a
					if (a <= n && b <= m) || (a <= m && b <= n) {
						ok = true
						break
					}
				}
			}
		}

		if ok {
			out.WriteString("Yes\n")
		} else {
			out.WriteString("No\n")
		}
	}

	fmt.Print(out.String())
}