#include #include using namespace std; //最大公約数 int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int main(int argc, char* argv[]) { int i,n1,n2; cin>>n1; int A; int A1=1; int A2=1; cin>>A1; for (i=2;i<=n1;i++){ cin>>A; A2*=A; } cin>>n2; int B; int B1=1; cin>>B1; int B2=1; for (i=2;i<=n2;i++){ cin>>B; B2*=B; } int A3=A1*B2; int B3=A2*B1; int C=gcd(A3,B3); cout<