#include<bits/stdc++.h>
#define int long long 
using namespace std;
int T,n;
const int N=10e6;
int a[N],b[N];
int Q;
int l,r;
int ans;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))
	{
		f=ch!='-';
		ch=getchar();
	}
	while(isdigit(ch))
	{
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return f?x:-x;
}

signed  main()
{
	freopen("match.in","r",stdin);
	freopen("match.out","w",stdout);
	cin>>T>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<=n;i++)
	{
		cin>>b[i];
	}
	ans=(a[1]*a[2])*2*n;
	cin>>Q;
	while(Q--)
	{
		cin>>l>>r;
		cout<<ans;
	}

	
}