#K70477. Load Distribution Among Servers
Load Distribution Among Servers
Load Distribution Among Servers
You are given t
test cases. In each test case, you have n
servers. For each server, you are given its capacity and the number of user connections that need to be handled. Your task is to determine if each server can handle its corresponding load. In other words, for each server index \( i \), you need to check if
\( users_i \leq capacities_i \)
If the inequality holds for every server in a test case, output YES
; otherwise, output NO
.
Note: The conditions must be checked index-by-index; reordering of servers or loads is not allowed.
inputFormat
The input is read from standard input and has the following format:
- An integer
t
representing the number of test cases. - For each test case:
- An integer
n
denoting the number of servers. - A line containing
n
space-separated integers representing the capacities of the servers. - A line containing
n
space-separated integers representing the number of user connections for each server.
outputFormat
For each test case, output a single line containing YES
if every server can handle its load, or NO
if at least one server cannot.
1
3
10 20 30
10 20 30
YES
</p>