← Home
```go
package main

import (
	"bufio"
	"os"
	"strconv"
)

func main() {
	// Use buffered IO for fast input reading
	scanner := bufio.NewScanner(os.Stdin)
	// Increase buffer size to handle very long lines (n, m up to 2*10^5 integers)
	buf := make([]byte, 2048*1024)
	scanner.Buffer(buf, 100*1024*1024)
	scanner.Split(bufio.ScanWords)

	// Helper function to read next integer
	nextInt := func() int {
		scanner.Scan()
		val, _ := strconv.Atoi(scanner.Text())
		return val
	}

	if !scanner.Scan() {
		return
	}
	n, _ := strconv.Atoi(scanner.Text())
	m := nextInt()
	q := nextInt()

	// Read array a and compute sumA
	a := make([]int, n)
	var sumA int64
	for i := 0; i < n; i++ {
		a[i] = nextInt()
		sumA += int64(a[i])
	}

	// Read array b and compute sumB
	b := make([]int, m)
	var sumB int64
	for i := 0; i < m; i++ {
		b[i] = nextInt()
		sumB += int64(b[i])
	}

	// The problem asks if there exist r, c such that (SumA - a[r]) * (SumB - b[c]) = x.
	// Since 1 <= |x| <= 2*10^5, the factors (SumA - a[r]) and (SumB - b[c]) must be divisors of x.
	// Thus, their absolute values (if non-zero) must be <= 2*10^5.
	// We can precompute which values in range [-200000, 200000] are available for A and B.

	const MAX_VAL = 200000
	const OFFSET = 200000
	const ARR_SIZE = 400005

	hasA := make([]bool, ARR_SIZE)
	for _, val := range a {
		diff := sumA - int64(val)
		if diff >= -MAX_VAL && diff <= MAX_VAL {
			hasA[int(diff)+OFFSET] = true
		}
	}

	hasB := make([]bool, ARR_SIZE)
	for _, val := range b {
		diff := sumB - int64(val)
		if diff >= -MAX_VAL && diff <= MAX_VAL {
			hasB[int(diff)+OFFSET] = true
		}
	}

	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	for k := 0; k < q; k++ {
		x := nextInt()
		
		// x is non-zero as per constraints 1 <= |x|.
		// We iterate through divisors of |x|.
		
		absX := x
		if absX < 0 {
			absX = -absX
		}

		possible := false
		for d := 1; d*d <= absX; d++ {
			if absX%d == 0 {
				d1 := d
				d2 := absX / d
				
				// Possible values for u (factor from A side) are d1, -d1, d2, -d2
				// We check if u exists in A, and if v = x/u exists in B.
				
				candidates := []int{d1, -d1}
				if d1 != d2 {
					candidates = append(candidates, d2, -d2)
				}

				for _, u := range candidates {
					// v is the required factor from B side
					v := x / u
					
					// Check if u and v are within the tracked range and exist
					if u >= -MAX_VAL && u <= MAX_VAL && v >= -MAX_VAL && v <= MAX_VAL {
						if hasA[u+OFFSET] && hasB[v+OFFSET] {
							possible = true
							break
						}
					}
				}
				if possible {
					break
				}
			}
		}

		if possible {
			writer.WriteString("YES\n")
		} else {
			writer.WriteString("NO\n")
		}
	}
}
```