Răspuns
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("test.in");
ofstream g("test.out");
int a[1001],b[1001],s,n,i,x,r;
int main()
{
f>>n;
s=0;x=0;
for(i=1;i<=n;i++)
f>>a[i];
for(i=1;i<=n;i++)
f>>b[i];
for(i=1;i<=n;i++)
{
x=pow(a[i],b[i]);
r=x%6669666;
s=s+r;
}
g<<s<<" ";
return 0;
}
Explicație: