#include #include #include #include #include #include #include #include using namespace std; int main(){ int n1, n2; int a1; int a2 = 1; int b1; int b2 = 1; int tmpa, tmpb; cin >> n1; int i; cin >> a1; for(i = 0; i < n1 - 1; i++){ cin >> tmpa; a2 *= tmpa; } cin >> n2; cin >> b1; for(i = 0; i < n2 - 1; i++){ cin >> tmpb; b2 *= tmpb; } int ans1, ans2; ans1 = a1 * b2; ans2 = a2 * b1; int a = ans1; int b = ans2; int tmp, r; /* 自然数 a > b を確認・入替 */ if(a