Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int maxn = 200 + 100;
- int n, m, k;
- LL ans;
- LL a[maxn], b[maxn], c[maxn];
- int main() {
- #ifdef ExRoc
- freopen("test.txt", "r", stdin);
- #endif // ExRoc
- ios::sync_with_stdio(false);
- cin >> n >> m >> k;
- for (int i = 0; i < n; ++i) {
- cin >> a[i];
- }
- for (int i = 0; i < m; ++i) {
- cin >> b[i];
- }
- for (int i = 0; i < k; ++i) {
- cin >> c[i];
- }
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < m; ++j) {
- for (int kk = 0; kk < k; ++kk) {
- ans = max(ans, a[i] * b[j] % c[kk]);
- }
- }
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement