#include
#include <math.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int Q;
cin >> Q;
int x[Q];
for (int i = 0; i < Q; i++)
{
cin >> x[i];
}
int sum1[n];
for (int i = 0; i < n; i++)
{
int j = i - x[0];
if (j < 0)
{
j = j + n;
}
sum1[i] = a[i] + a[j];
}
int sum2[n];
for (int i = 0; i < n; i++)
{
int j = i - x[1];
if (j < 0)
{
j = j + n;
}
sum2[i] = sum1[i] + sum1[j];
}
int sum = 0;
for (int i = 0; i < n; i++)
{
sum = sum + sum2[i];
}
int temp;
temp = (sum) % (1000000007);
cout << temp;
return 0;
}
it have passed only one test case why plz correct my code