A + B Queries

시간 제한1초메모리 제한2048 MB

문제

The Quechuas welcome you to IOI 2025 with a special gift: two arrays, $A$ and $B$, each of length $N$. The elements in both arrays are indexed from $0$ to $N − 1$.

To ensure that you are taking good care of their gift, they will ask you $Q$ questions, one at a time. Each question consists of two indices, $i$ and $j$, and asks: What is the sum of $A[i]$ and $B[j]$?

제한

  • $1 ≤ N ≤ 200\, 000$
  • $0 ≤ A[k],B[k] ≤ 10$ for each $k$ such that $0 ≤ k < N$.
  • $1 ≤ Q ≤ 200\, 000$
  • $0 ≤ i, j < N$ in each question.