AtCoder Beginner Contest 098 - Add Sub Mul

You are given two integers A and B.
Find the largest value among A+B, A-B and A \times B.

-----Constraints-----
 - -1000 \leq A,B \leq 1000
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
A B

-----Output-----
Print the largest value among A+B, A-B and A \times B.

-----Sample Input-----
3 1

-----Sample Output-----
4

3+1=4, 3-1=2 and 3 \times 1=3. The largest among them is 4.

Difficulty: EASY

Starter code:

Solutions:
(a, b) = map(int, input().split())
re = [a + b, a - b, a * b]
print(max(re))


(A, B) = map(int, input().split())
li = [A + B, A - B, A * B]
print(max(li))


(a, b) = list(map(int, input().split()))
print(max(a + b, a - b, a * b))


(A, B) = [int(x) for x in input().split()]
print(max(A - B, A + B, A * B))


(A, B) = [int(i) for i in input().split()]
print(max(A + B, A - B, A * B))


(A, B) = tuple(map(int, input().split()))
print(max([A + B, A - B, A * B]))


(A, B) = map(int, input().split())
ans = [A + B, A - B, A * B]
print(max(ans))


(a, b) = map(int, input().strip().split(' '))
print(max(a + b, a - b, a * b))


(A, B) = map(int, input().split())
L = [A + B, A - B, A * B]
L.sort()
print(L[2])


(A, B) = map(int, input().split())
M = max(A + B, A - B, A * B)
print(M)


(a, b) = map(int, input().split())
c = max([a + b, a - b, a * b])
print(c)


(a, b) = map(int, input().split())
z = [a + b, a - b, a * b]
print(max(z))


(A, B) = map(int, input().split())
lst = [A + B, A * B, A - B]
print(max(lst))


(a, b) = map(int, input().split())
print(max(a + abs(b), a * b))


(A, B) = map(int, input().split())
r = max(A + B, A - B, A * B)
print(r)


import math
(a, b) = map(int, input().split())
print(max(a + b, a - b, a * b))


(x, y) = map(int, input().split())
a = [x + y, x - y, x * y]
print(max(a))


(a, b) = map(int, input().split())
ans = max(a + b, a - b)
print(max(ans, a * b))


(m, n) = map(int, input().split())
a = [m - n, m + n, m * n]
print(max(a))


(A, B) = map(int, input().split())
print(str(max(A + B, A - B, A * B)))


(a, b) = map(int, input().split())
list01 = [a + b, a * b, a - b]
print(max(list01))


(a, b) = map(int, input().split())
L = (a + b, a - b, a * b)
print(max(L))


(a, b) = map(int, input().split(' '))
A = a + b
B = a - b
C = a * b
print(max(A, B, C))


(a, b) = map(int, input().split())
tintin = [a + b, a - b, a * b]
print(max(tintin))


(A, B) = map(int, input().split())
X = [A + B, A - B, A * B]
print(max(X))


(a, b) = map(int, input().split())
c = [a + b, a - b, a * b]
c.sort()
print(c[2])


(a, b) = map(int, input().split())
ma = max(a + b, a - b, a * b)
print(ma)


(A, B) = map(int, input().rstrip().split())
print(max(A + B, A - B, A * B))


import sys

def input():
	return sys.stdin.readline().strip()

def I():
	return int(input())

def LI():
	return list(map(int, input().split()))

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def S():
	return input()

def LS():
	return input().split()
INF = float('inf')
(a, b) = LI()
print(max(a + b, a - b, a * b))


(A, B) = list(map(int, input().split(' ')))
print(max(A + B, A - B, A * B))


[a, b] = [int(i) for i in input().split()]
print(max(a + b, a - b, a * b))


(a, b) = input().split()
a = int(a)
b = int(b)
print(max(a + b, a - b, a * b))


(a, b) = map(int, input().split())
n = [a + b, a - b, a * b]
print(max(n))


(A, B) = map(int, input().split())
S = [A + B, A * B, A - B]
print(max(S))


(a, b) = map(int, input().split())
s = a + b
t = a - b
w = a * b
print(max(s, t, w))


(A, B) = map(int, input().split())
lists = [A + B, A - B, A * B]
print(max(lists))


(A, B) = map(int, input().split())
X = A * B
Y = A - B
Z = A + B
print(max(X, Y, Z))


(x, y) = input().split()
print(max((eval(x + c + y) for c in '*+-')))


(a, b) = map(int, input().split())
d = a + b
e = a - b
f = a * b
print(max(d, e, f))


(a, b) = [int(_) for _ in input().split()]
print(max(a + b, a - b, a * b))


(a, b) = map(int, input().split())
p = a + b
t = a * b
m = a - b
print(max(p, t, m))


(A, B) = map(int, input().split())
x = A + B
y = A - B
z = A * B
C = max(x, y, z)
print(C)


(s, t) = map(int, input().split())
print(max(s + t, s - t, s * t))


(a, b) = map(int, input().split())
box = [a + b, a - b, a * b]
print(max(box))


(a, b) = map(int, input().split())
x = max(a + b, a - b, a * b)
print(x)


a = list(map(int, input().split()))
b = a[0] * a[1]
c = a[0] - a[1]
d = a[0] + a[1]
print(max(b, c, d))


(a, b) = map(int, input().split())
k = a + b
m = a - b
n = a * b
print(max(k, m, n))


(a, b) = (int(x) for x in input().split())
x = a + b
y = a - b
z = a * b
if x >= y and x >= z:
	print(x)
elif y >= x and y >= z:
	print(y)
else:
	print(z)


(a, b) = map(int, input().split())
m = max(a + b, a - b, a * b)
print(m)


(a, b) = map(int, input().split())
x = a + b
y = a - b
z = a * b
print(max(x, y, z))


a = input()
print(max((eval(a.replace(' ', k)) for k in '+-*')))


(a, b) = map(int, input().split())
s = [a + b, a - b, a * b]
print(max(s))


(A, B) = map(int, input().split())
a = A + B
b = A - B
c = A * B
print(max(a, b, c))


(n, m) = [int(i) for i in input().split()]
print(max(n - m, n + m, n * m))


(A, B) = map(int, input().split())
C = [A + B, A - B, A * B]
print(max(C))


(a, b) = map(int, input().split())
cal = [a + b, a - b, a * b]
print(max(cal))


(a, b) = [int(v) for v in input().split()]
print(max(a + b, a - b, a * b))


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inm = lambda : map(int, sys.stdin.readline().split())
inl = lambda : list(inm())
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
(A, B) = inm()
l = []
l.append(A + B)
l.append(A - B)
l.append(A * B)
print(max(l))


(a, b) = map(int, input().split())
d = a + b
s = a - b
m = a * b
print(max(d, s, m))


def main():
	(A, B) = list(map(int, input().split()))
	ans = max(A + B, A - B, A * B)
	print(ans)

def __starting_point():
	main()
__starting_point()


(a, b) = map(int, input().split())
A = [a + b, a - b, a * b]
print(max(A))


(x, y) = [int(i) for i in input().split()]
print(max(x + y, x - y, x * y))


def LI():
	return list(map(int, input().split()))
(A, B) = LI()
print(max(A + B, A - B, A * B))


(A, B) = map(int, input().split())
N = [A + B, A - B, A * B]
print(max(N))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
from collections import deque
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def main():
	(A, B) = LI()
	print(max(A + B, A - B, A * B))
main()


(a, b) = map(int, input().split())
c = []
c.append(a + b)
c.append(a - b)
c.append(a * b)
c = sorted(c, reverse=True)
print(c[0])


(A, B) = (int(X) for X in input().split())
print(max(A + B, A - B, A * B))


(A, B) = map(int, input().split())
C = A + B
D = A - B
E = A * B
print(max(C, D, E))


(a, b) = map(int, input().split())
li = [a + b, a - b, a * b]
print(max(li))


(A, B) = map(int, input().split(' '))
m = max(A * B, A + B, A - B)
print(m)


(a, b) = map(int, input().split())
d = [a + b, a - b, a * b]
print(max(d))


(x, y) = map(int, input().split())
nlist = [x + y, x - y, x * y]
print(max(nlist))


(A, B) = map(int, input().split())
Max = [A + B, A - B, A * B]
print(max(Max))


import sys
(A, B) = list(map(int, input().split()))
print(max(A + B, A - B, A * B))


(a, b) = map(int, input().split())
result = max(a + b, a - b)
result = max(result, a * b)
print(result)


x = input().split()
(a, b) = (int(x[0]), int(x[1]))
print(max(a * b, a - b, a + b))


(A, B) = map(int, input().split())
diff = [A + B, A - B, A * B]
print(max(diff))


(a, b) = map(int, input().split())
print('{}'.format(max(a + b, a - b, a * b)))


(a, b) = map(int, input().rstrip().split())
print(max(a + b, a - b, a * b))


import sys
stdin = sys.stdin

def ns():
	return stdin.readline().rstrip()

def ni():
	return int(stdin.readline().rstrip())

def nm():
	return list(map(int, stdin.readline().split()))

def nl():
	return list(map(int, stdin.readline().split()))

def main():
	(a, b) = nm()
	print(max(a + b, a - b, a * b))

def __starting_point():
	main()
__starting_point()


(a, b) = input().split()
a = int(a)
b = int(b)
ls = [a + b, a - b, a * b]
ls.sort()
print(ls[2])


(a, b) = map(int, input().split())
maximum = max(a + b, a - b, a * b)
print(maximum)


(A, B) = map(int, input().split())
sum = [A + B, A - B, A * B]
print(max(sum))


def mapt(fn, *args):
	return tuple(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(a, b) = Input()
	print(max(a + b, a * b, a - b))
main()


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '3 1'
		output = '4'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '4 -2'
		output = '6'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '0 0'
		output = '0'
		self.assertIO(input, output)

def resolve():
	(A, B) = list(map(int, input().split()))
	print(max(A + B, A - B, A * B))

def __starting_point():
	resolve()
__starting_point()


(a, b) = [int(x) for x in input().split()]
print(max(a + b, a - b, a * b))


(a, b) = map(int, input().split())
c = a + b
d = a * b
e = a - b
print(max(c, d, e))


lst = input().split()
a = int(lst[0])
b = int(lst[1])
print(max([a + b, a - b, a * b]))


(a, b) = [int(s) for s in input().split()]
print(max([a + b, a - b, a * b]))


(a, b) = map(int, input().split())
a_list = [a + b, a - b, a * b]
print(max(a_list))


(a, b) = map(int, input().split())
A = [a + b, a - b, a * b]
A.sort()
print(A[-1])


(a, b) = map(int, input().split())
num = [a + b, a - b, a * b]
print(max(num))


(a, b) = map(int, input().split())
ret = max(a + b, a - b, a * b)
print(ret)


(a, b) = map(int, input().split())
l = [a + b, a - b, a * b]
print(max(l))


(A, B) = map(int, input().split())
l = [A + B, A - B, A * B]
print(max(l))


(A, B) = map(int, input().split())
calc = [A + B, A - B, A * B]
print(max(calc))


(a, b) = map(int, input().split())
ls = [a + b, a - b, a * b]
print(int(max(ls)))


(A, B) = map(int, input().split())
L = [A + B, A - B, A * B]
print(max(L))