noip2014d1t1(生活大爆炸版石头剪刀布)
#include<iostream>
using namespace std;
int n,a1,b1,xa,xb;
int a[210],b[210];
int mac[5][5]={{0,0,1,1,0},{1,0,0,1,0},{0,1,0,0,1},{0,0,1,0,1},{1,1,0,0,0}};
int main()
{
cin>>n>>a1>>b1;
for(int i=0;i<a1;i++)
{
cin>>a[i];
}
for(int i=0;i<b1;i++)
{
cin>>b[i];
}
for(int i=0;i<n;i++)
{
xa+=mac[a[i%a1]][b[i%b1]];
xb+=mac[b[i%b1]][a[i%a1]];
}
cout<<xa<<" "<<xb<<endl;
return 0;
}