voidsolve(){ for (int i = 1; i <= 27; i++) { int ai = getI(2, i), bi = getI(5, i); cout << "i:" << i << ", aI = " << ai << ", bI = " << bi; if (mp[ai * bi]) cout << ", " << ai * bi << endl; else cout << endl; mp[ai * bi] = 1; } }
voidsolve(){ cin >> n >> m >> k; for (int i = 1; i <= n; i++) cin >> a[i]; for (int i = 1; i <= m; i++) cin >> b[i]; for (int i = 1; i <= k; i++) cin >> c[i];
int maxx = 0;
for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) for (int t = 1; t <= k; t++) maxx = max(maxx, (a[i] * b[j]) % c[t]); cout << maxx << endl; }