import sys input = sys.stdin.readline from functools import lru_cache K,N,M=map(int,input().split()) A=list(map(int,input().split())) C=list(map(int,input().split())) mod=10**9+7 for i in range(N): sc=0 for j in range(K): sc+=C[j]*A[-1-j] sc%=mod A.append(sc) AC=[[] for i in range(N)] for i in range(N): X=[] sc=0 for j in range(K): if i-j>=0: X.append(A[i-j]*C[j]%mod) else: X.append(0) X.reverse() for j in range(1,len(X)): X[j]=(X[j]+X[j-1])%mod for j in range(len(X)): X[j]=-X[j]%mod AC[i]=X CL=[-1]*K def calc_l(x): if CL[x]!=-1: return CL[x] ANS=A[x] for i in range(1,K): if x-i>=0: ANS=(ANS-A[x-i]*C[i-1])%mod CL[x]=ANS return ANS for i in range(K): CL[i]=calc_l(i) def calc_r(stind,x): return AC[stind+x][-x-1] S=[0]*N for i in range(M): l,r=map(int,input().split()) for j in range(K): if l+j=0: ANS[i]=(ANS[i]+ANS[i-j-1]*C[j])%mod print("\n".join(map(str,ANS)))