#K90232. Chef's Array Sum Comparison
Chef's Array Sum Comparison
Chef's Array Sum Comparison
You are given two arrays \(A\) and \(B\) both of length \(N\). For each test case, you need to determine whether the sum of the elements of array \(A\) is strictly greater than the sum of the elements of array \(B\). Formally, let \(S_A = \sum_{i=1}^{N} A_i\) and \(S_B = \sum_{i=1}^{N} B_i\). Your task is to check if \(S_A > S_B\). If the condition holds, print YES
; otherwise, print NO
.
Note: The input is provided via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains an integer \(T\) representing the number of test cases. For each test case, the input is formatted as follows:
- An integer \(N\) denoting the number of elements in each array.
- A line with \(N\) space-separated integers representing array \(A\).
- A line with \(N\) space-separated integers representing array \(B\).
These values are given consecutively for each test case.
outputFormat
For each test case, output a single line containing YES
if the sum of array \(A\) is greater than the sum of array \(B\), otherwise output NO
.
1
3
1 2 3
4 5 6
NO
</p>