#define _CRT_SECURE_NO_WARNINGS #define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING #include using namespace std; int main() { int n, m, r; scanf("%d%d%d", &n, &m, &r); int m1 = numeric_limits::max(), m2 = numeric_limits::min(); for (int i = 0, x; i < n; i++) scanf("%d", &x), m1 = min(m1, x); for (int i = 0, x; i < m; i++) scanf("%d", &x), m2 = max(m2, x); printf("%d", max(r, r / m1 * m2 + r % m1)); return 0; }