Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = map(int, raw_input().split())
- t = map(int, raw_input().split())
- b = map(int, raw_input().split())
- maiores = max(t)*max(b)
- menores = min(t)*min(b)
- inverse1 = max(t)*min(b)
- inverse2 = min(t)*max(b)
- final = max([maiores, menores, inverse1, inverse2])
- if final == maiores or final == inverse1:
- t.remove(max(t))
- else: t.remove(min(t))
- maiores = max(t)*max(b)
- menores = min(t)*min(b)
- inverse1 = max(t)*min(b)
- inverse2 = min(t)*max(b)
- print max([maiores, menores, inverse1, inverse2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement