Problem:


Score : 100 points

Problem Statement

We have two integers: A and B.

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

Constraints

All values in input are integers.

-100 \leq A,\ B \leq 100

Input

Input is given from Standard Input in the following format:

A B

Output

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

Sample Input 1

-13 3

Sample Output 1

-10

The largest number among A + B = -10, A - B = -16, and A \times B = -39 is -10.

Sample Input 2

1 -33

Sample Output 2

34

The largest number among A + B = -32, A - B = 34, and A \times B = -33 is 34.

Sample Input 3

13 3

Sample Output 3

39

The largest number among A + B = 16, A - B = 10, and A \times B = 39 is 39.



Sample input:
-13 3


Sample output:
-10

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
X = A + B
Y = A - B
Z = A * B

chinchin = [X, Y, Z]
print(max(chinchin))

Submission status: Runtime Error

Solution code:
a, b = (int(i) for i in input().split())  
sum=a+b
dif=a-b
mul=a*b


if sum > dif:
	if mul>sum:
    	print("{}".format(mul))
	else:
    	print("{}"format(sum))
else:
	if mul>dif:
    	print("{}".format(mul))
	else:
    	print("{}"format(dif))

Submission status: Runtime Error

Solution code:
a, b = (int(i) for i in input().split())  

if a+b > a-b:
	if a*b>a+b:
    	print("{}".format(a*b))
	else:
    	print("{}"format(a+b))
else:
	if a*b>a-b:
    	print("{}".format(a*b))
	else:
    	print("{}"format(a-b))

Submission status: Runtime Error

Solution code:
N = int(input())
strings = []
for i in range(N):
    strings.append(str(input()))


strings = [''.join(sorted(s)) for s in strings]
strings.sort()

for s in strings:
    print(s)


hashMap = {}
for string in strings:
    if string not in hashMap:
        hashMap[str(string)] = 1
    else:
        hashMap[str(string)] += 1


sum = 0

for key in hashMap:
    v = hashMap[key]
    sum += v * (v - 1) / 2
print(int(sum))

Submission status: Runtime Error

Solution code:
N = int(input())
strings = []
for i in range(N):
    strings.append(input())


strings = [''.join(sorted(s)) for s in strings]
strings.sort()

for s in strings:
    print(s)


hashMap = {}
for string in strings:
    if string not in hashMap:
        hashMap[str(string)] = 1
    else:
        hashMap[str(string)] += 1


sum = 0

for key in hashMap:
    v = hashMap[key]
    sum += v * (v - 1) / 2
print(int(sum))

Submission status: Runtime Error

Solution code:
k, x = map(int,input().split())
print(sorted(x, reverse=True))

Submission status: Runtime Error

Solution code:
a, b = map(int, input())
print(max([a+b, a-b, a*b]))

Submission status: Runtime Error

Solution code:
N = int(input())

s = []
for i in range(N):
    s.append(''.join(sorted(input())))

s = sorted(s)

tmp_count = 1
count = 0
for i in range(0, len(s)-1):
    if s[i] == s[i+1]:
        tmp_count += 1
    else:
        count += tmp_count * (tmp_count - 1) // 2
        tmp_count = 1
count += tmp_count * (tmp_count - 1) // 2
print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
b = int(input())

# 出力
print(max([a+b, a-b, a*b]))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
S=[]
for n in range(N):
    S.append(input())
Slist = []
for s in S:
    lists = list(s)
    listss = sorted(lists)
    Slist.append(listss)
def isAna2(Sl,sl):
    boolcount = True
    for i,Sli in enumerate(Sl):
        if Sli != sl[i]:
            boolcount = False
            break
    return boolcount
count = 0
for i,Sl in enumerate(Slist):
    for sl in Slist[i+1:]:
        if isAna2(Sl,sl) == True:
            count+=1
print(count)

Submission status: Runtime Error

Solution code:
num1,num2 = map(int,input(),split())

 
num3 = num1 + num2
num4 = num1 - num2
num5 = num1 * num2
num6 = [num3, num4, num5]
 
print(max(num6))

Submission status: Runtime Error

Solution code:
num1,num2 = map(int,input(),split())
while str(num1).isdigit() == False:

    

num3 = int(num1) + int(num2)
num4 = int(num1) - int(num2)
num5 = int(num1) * int(num2)
num6 = [num3, num4, num5]
 
print(max(num6))

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())

c=a+b
if c<a-b :
  c=a-b
if c<ab :
  c=ab
print(c)

Submission status: Runtime Error

Solution code:
import heapq
n,m = map(int,input().split())
l = []
for i in range(n):
  a,b = map(int,input().split())
  l.append([a,b])
l = sorted(l, key=lambda x: (x[0],x[1]))
b = []
heapq.heapify(l)
j = 0
q = 0
for i in range(m):
  key = i+1
  if j >= n+1:
    break
  while j < n:
    if l[j][0] != key:
      break
    heapq.heappush(b,-l[j][1])
    j += 1
  if b != []:
    heapq.heapify(b)
    k = -heapq.heappop(b)
    q += k
print(q)

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reverse)
print(aaa[0])

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

aaa = sorted([x,y,z], reseve)
print(aaa[0])

Submission status: Runtime Error

Solution code:
A,B=int(input()),int(input())
C=A+B
D=A-B
E=A*B
if C>D and C>E:
    print(C)
elif D>C and D>E:
    print(D)
elif E>C and E>D:
    print(E)

Submission status: Runtime Error

Solution code:
a = int(input().split())

x = a[0] + a[1]
y = a[0] - a[1]
z = a[0] * a[1]

if x > y and x > z:
  print('x')
elif y > x and y > z:
  print('y')
else:
  print('z')

Submission status: Runtime Error

Solution code:
s

Submission status: Runtime Error

Solution code:
a,b = [int(i) for i in input()]

print(max([a + b, a - b, a * b]))

Submission status: Runtime Error

Solution code:
int main() {
    int a, b;
    cin >> a >> b;
    int c = a * b;
    if (c % 2 == 0) cout << "Even" << endl;
    else cout << "Odd" << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = [int(i) for i in input().split(' ')]
result = []
result.append(a + b)
result.append(a - b)
result.append(a * b)

print(result.max())

Submission status: Runtime Error

Solution code:
a=A+B
b=A-B
c=A*B
if a>b and a>c:
  print(a)
  elif b>a and b>c:
    print(b)
    elif c>a and c>b
    print(c)

Submission status: Runtime Error

Solution code:
I=int(input().split())
x=int(input().split())
y=int(input().split())

if (min(y,I[3])-max(x,I[2]))>0:
    print('No War')
    
else :
    print('War')

Submission status: Runtime Error

Solution code:
import numpy as np

A, B = map(int, input().split())

print(np.max(A-B, A+B, A*B)

Submission status: Runtime Error

Solution code:
import sys
a,b=map(int, input().split())

if a-b > a+b:
    elif a-b > a*b:
        print(a-b)
    else:
        print(a*b)
elif a*b > a+b:
    elif a*b > a-b:
        print(a*b)
    else:
        print(a-b)

Submission status: Runtime Error

Solution code:
import sys
a,b=map(int, input().split())

max = a + b

if a-b > max:
    elif a-b > a*b:
        print(a-b)
    else:
        print(a*b)
elif a*b > max:
    elif a*b > a-b:
        print(a*b)
    else:
        print(a-b)

Submission status: Runtime Error

Solution code:
import sys
a = int(input())
b = int(input())

max = a + b

if a - b > max:
    print(a-b)
elif a*b > max:
    print(a*b)
else:
    print(max)

Submission status: Runtime Error

Solution code:
import sys
 
args = sys.argv

print(args[0])
 
a = int(args[1])
b = int(args[2])
 
sum = a + b
minus = a - b
sub = a * b
 
if (sum - minus) > 0:
  print("足し算のが引き算より大きい")
  if (sum - sub) > 0:
    print("足し算のが掛け算より大きい")
    print(sum)
  else:
    print("掛け算のが足し算より大きい")
    print(sub)
else:
  print("引き算のが足し算より大きい")
  if (minus - sub) > 0:
    print("引き算のが掛け算より大きい")
    print(minus)
  else:
    print("掛け算のが引き算より大きい")
    print(sub)

Submission status: Runtime Error

Solution code:
import sys
 
args = sys.argv

print(args[0])
 
a = int(args[1])
b = int(args[2])
 
sum = a + b
minus = a - b
sub = a * b
 
if (sum - minus) < 0:
  print("足し算のが引き算より小さい")
  if (sum - sub) < 0:
    print("足し算のが掛け算より小さい")
    print(sum)
  else:
    print("掛け算のが足し算より小さい")
    print(sub)
else:
  print("引き算のが足し算より小さい")
  if (minus - sub) < 0:
    print("引き算のが掛け算より小さい")
    print(minus)
  else:
    print("掛け算のが引き算より小さい")
    print(sub)

Submission status: Runtime Error

Solution code:
import sys

args = sys.argv

a = args[0]
b = args[1]

sum = a + b
minus = a - b
sub = a * b

if sum - minus < 0:
  if sum - sub < 0:
    return sum
  return sub

if minus - sub < 0:
  return sub

return minus

Submission status: Runtime Error

Solution code:
(lambda x, y: print(max(a+b, a-b, a*b)))(map(int,input().split()))

Submission status: Runtime Error

Solution code:
from itertools import combinations

N = int(input())
s = [sorted(input(i)) for i in range(N)]

c = len([i for i in combinations(s, 2) if i[0] == i[1]])
print(c)

Submission status: Runtime Error

Solution code:
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
if a == 0 & b == 0 :
    perse = 0
else :
    perse = a/b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Submission status: Runtime Error

Solution code:
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
        flag = False
    else :
        if l >= box :
            box = l
print(box)

Submission status: Runtime Error

Solution code:
i = list(map(int,input().split()))

a = i[0]
b = i[1]

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
    else :
        if l >= box :
            box = l
print(box)

Submission status: Runtime Error

Solution code:
i = input().sprit

a = int(i[0])
b = int(i[1])

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = True
for l in list :
    if flag :
        box = l
    else :
        if l >= box :
            box = l
print(box)

Submission status: Runtime Error

Solution code:
i = input().sprit

a = int(i[0])
b = int(i[1])

plus = a + b
minus = a - b
add = a * b
perse = a / b

list = [plus, minus, add, perse]

flag = true
for l in list
	if flag :
    	box = l
    else
    	if l >= box
      		box = l
print(box)

Submission status: Runtime Error

Solution code:
count = int(input())

str_data = {}

for i in range(count):
  judge_str = ''.join(sorted(input()))
  if judge_str in str_data:
    str_data[judge_str] += 1
  else:
    str_data[judge_str] = 0

print(sum(str_data.values())

Submission status: Runtime Error

Solution code:
a,b = input().split(' ')

print(max(a*b,a-b,a+b))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

a,b = map(int,input().split())
ans_add = a + b
ans_sub = a - b
ans_mul = a * b

if ans_add > ans_sub:
    ans = ans_add

if ans_sub > ans_mul:
    ans = ans_sub

if ans_mul > ans_add:
    ans = ans_mul

print(ans)

Submission status: Runtime Error

Solution code:
num1 = input('整数を入力してください：')

while num1.replace('-', '').isdigit() == False or int(num1) < -100:
    print('Error')
    num1 = input('整数を入力してください：')
else:
    num1 = int(num1)
num1 = int(num1)



num2 = input('整数を入力してください：')

while num2.replace('-', '').isdigit() == False or int(num2) > 100:
    print('Error')
    num2 = input('整数を入力してください：')
else:
    num2 = int(num2)
num2 = int(num2)


plus = num1 + num2
minus = num1 - num2
times = num1 * num2

list = [plus,minus,times]

print(max(list))

Submission status: Runtime Error

Solution code:
a,b,c = map(int, input().split())

print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
import heapq
n,m = map(int, input().split())
job_list = []
for i in range(n):
    a,b = map(int, input().split())
    job_list.append((a,b))

hq = []
max_income = 0
j = 0
for i in range(1,m+1):
    while j < n and job_list[j][0] <= i:
        heapq.heappush(hq, (-job_list[j][1],job_list[j][0]))
    if len(hq) < 1:
        continue
    b_i, a_i = heapq.heappop(hq)
    max_income += -b_i

print(max_income)

Submission status: Runtime Error

Solution code:
print(max(A + B,A - B,A * B))

Submission status: Runtime Error

Solution code:
K,X=map(int,input().split())

for i in range(X-K+1,X+K):
  string+=i+' '
print(string)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
print(max({a+b,a-b,a*b})

Submission status: Runtime Error

Solution code:
a ,b = input().split()

max = a+b
if a-b > max:
  max = a-b
elif a*b > max:
  max = a*b
else:
  pass
print(max)

Submission status: Runtime Error

Solution code:
a,b=map(int,input.split())

print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a,b=map(int,input.split())

print(max(a+b,a-b,a＊b))

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())

print(max(a+b,a*b,a-B))

Submission status: Runtime Error

Solution code:
n = int(input())
d = {}
ans = 0
for i in range(n):
    s = ''.join(sorted(input()))
    if s in d.keys():
        ans += d[s]
        d[s] += 1
    d.setdefault(s, 1)
print(ans)

Submission status: Runtime Error

Solution code:

a,b=int(input().split())

print(max(a*b,a-b,a+b))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().strip())

print(max(a+b, a-b, a * b))

Submission status: Runtime Error

Solution code:
print(max(A+B, A-B, A*B))

Submission status: Runtime Error

Solution code:
Max = max(A+B, A-B, A*B)
print(Max)

Submission status: Runtime Error

Solution code:
num1 = input("数字を入力してください")
while str(num1).isdigit() == False:
    print("error")
    num1 = input("数字を入力してください")
    
num2 = input("数字を入力してください")
while str(num2).isdigit() == False:
    print("error")
    num2 = input("数字を入力してください")
    
num3 = int(num1) + int(num2)
num4 = int(num1) - int(num2)
num5 = int(num1) * int(num2)
num6 = [num3, num4, num5]

if -100 < int(num1) < 100 and -100 < int(num2) < 100:
    print(max(num6))

Submission status: Runtime Error

Solution code:
num1 = int(input())
num2 = int(input())
num3 = num1 + num2
num4 = num1 - num2
num5 = num1 * num2
num6 = [num3, num4, num5]
print(max(num6))

Submission status: Runtime Error

Solution code:
num1 = int(input())
num2 = int(input())
num3 = num1 + num2
num4 = num1 - num2
num5 = num1 * num2
num6 = [num3, num4, num5]
print(max(num6))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if A+B > A-B and A*B:
  print(A+B)
elif A-B > A+B and A*B :
  print(A-B)
else A*B > A+B and A-B :
  print(A*B)

Submission status: Runtime Error

Solution code:
import sys

a = int(sys.argv[1])
b = int(sys.argv[2])

print(max(a+b, a-b, a*b))

Submission status: Runtime Error

Solution code:
a = sys.argv[0]
b = sys.argv[1]

print(max(a+b, a-b, a*b))

Submission status: Runtime Error

Solution code:
a = input()
b = int(a[0]) + int(a[2])
c = int(a[0]) - int(a[2])
d = int(a[0]) * int(a[2])
if b >= c and b >= d:
  print(b)
elif c >= b and c >= d:
  print(c)
else:
  print(d)

Submission status: Runtime Error

Solution code:
a = input()
b = input()
max([a+b, a-b, a*b])

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())

answer1=A+B
answer2=A-B
answer3=A*B

print(max(answer1,answer2,answer3))

Submission status: Runtime Error

Solution code:
input_A=input()
input_B=input()

A=int(input_A)
B=int(input_B)

answer1=A+B
answer2=A-B
answer3=A*B

print(max(answer1,answer2,answer3))

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))

Submission status: Runtime Error

Solution code:
values = map(int, input().split())
AplusB = values[0] + values[1]
AminusB = values[0] - values[1]
AtimesB = values[0] * values[1]
print(max([AplusB, AminusB, AtimesB]))

Submission status: Runtime Error

Solution code:
a,b=map(int,input(),split())
for i in range(2*a-1):
  print(b-a+1,end="")

Submission status: Runtime Error

Solution code:
a,b=map(int,input(),sprit())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a, b = map(int, imput().split())
c = [a + b , a - b, a * b]
print(max(c))

Submission status: Runtime Error

Solution code:
a, b = imput().split()
c = [a + b, a - b, a * b]
print(max(c))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

if(a >= -100 and b <= 100):
	l = [a+b,a-b,a*b]
	print(max(l))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

l = [a+b,a-b,a*b]

print(max(l))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())

print(max(a+b, a-b, a*b)

Submission status: Runtime Error

Solution code:
a,b = int(input())
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
a,b=input().split
print(max(a+b,a-b,a*b))

Submission status: Runtime Error

Solution code:
N = int(input())
s = []
for i in range(0,N):
    a = input()
    s.append(sorted(a))
t = 0
for i in range(0,N):
    for j in range(i+1,N):
        if s[i] == s[j]:
            t +=1
print(t)

Submission status: Runtime Error

Solution code:
N = int(input())
s = []
for i in range(0,N):
    a = input()
    s.append(sorted(a))
t = 0
while len(s)>0:
    a = s.count(s[0])
    if a==1:
        continue
    else:
        a = (a*(a-1))/2
        t = t+a
    s.remove(s[0])
print(t)

Submission status: Runtime Error

Solution code:
A,B = map(int,input())
print(max(A*B,A-B,A+B))

Submission status: Runtime Error

Solution code:
A,B=[int(e) for r in input().split(' ')]
print(max([A+B,A-B,A*B]))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
def main():
    A,B = map(int(input().split()))
    ans = []
    ans.append(A+B)
    ans.append(A-B)
    ans.append(A*B)
    print(max(ans))

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
ans = max(a-b, a+b , a*b)
print(ans)

Submission status: Runtime Error

Solution code:
a, b=map(int, input().split())
puls = a + b
m = a - b
x = a * b
print(max(plus,m,x))

Submission status: Runtime Error

Solution code:
a, b=map(int, input().split())
int puls = a + b
int m = a - b
int x = a * b
print(max(plus,m,x))

Submission status: Runtime Error

Solution code:
input int=a, int=b
int puls = a + b
int m = a - b
int x = a * b
print(max(plus,m,x))

Submission status: Runtime Error

Solution code:
n=int(input())
b=[str(sorted(list(input()))) for i in range(n)]
count=list(collections.Counter(b).values())
count=[i for i in count if i>1]
import math
print(int(sum([math.factorial(x)/(math.factorial(x-2)*2) for x in count])))

Submission status: Runtime Error

Solution code:
lis_raw=[int(i) for i in input().split()]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

Submission status: Runtime Error

Solution code:
lis_raw=input().split()
lis = [int(i) for i in lis]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

Submission status: Runtime Error

Solution code:
N = int(input())
s = [list(input()) for _ in range(N)]
S = []
for i in range(N):
    S.append("".join(sorted(s[i])))
print(S)

cnt = 0
for i in range(N):
    cnt += S.count(S[i]) - 1
print(int(cnt / 2))

Submission status: Runtime Error

Solution code:
a=input()
b=input()
print(max([a-b,a+b,a*b]))

Submission status: Runtime Error

Solution code:
A, B = [int(i) for i input().split(' ')]
print(max((A + B), (A - B), (A * B)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int(),input().sprit())
print(max(a + b,a - b,a * b))

Submission status: Runtime Error

Solution code:
x=input().split()

y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Submission status: Runtime Error

Solution code:
import sys
 
argv=sys.argv
 
x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]
 
print(max(y))

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
SUM = a+b
SUB = a-b
PRO = a*b
print(max(SUM,SUB,PRO)

Submission status: Runtime Error

Solution code:
import sys

argv=sys.argv

x=[0]*2
for i in range(2):
	x[i]=(int)(argv[i+1])
    
y=[0]*3
y[0]=x[0]+x[1]
y[1]=x[0]-x[1]
y[2]=x[0]*x[1]

print(max(y))

Submission status: Runtime Error

Solution code:
argv=sys.argv

x=[0]*2
for i in range(10):
	x[i]=(int)(argv[i+1])
    
MAX=x[0]+x[1]
MIN=x[0]-x[1]
MUL=x[0]*x[1]

print(max(MAX,MIN,MUL))

Submission status: Runtime Error

Solution code:
#N is numbers of BAITO, M is limit of days
N,M=map(int,input().split())

i=0
inp ={}
while i<N:
  readTime,inCome=map(int,input().split())
  if readTime in inp:
    inp[readTime].append(inCome)
  else:
    inp[readTime]=[inCome]
  
  i=i+1

#print(inp)  

result=0
pool=[]
i=1
while i<=M:
  if i in inp:
	  pool=pool+inp[i]
  #print(i,pool)
  
  if len(pool)>0:
    result=result+max(pool)
    pool.remove(max(pool))
    #print(pool)
  
  i=i+1
 
print(result)

Submission status: Runtime Error

Solution code:
l = input().split()
l = [int(i) for i in l]
p = l[0]
q = l[1]
return max(p+q, p-q, p*q)

Submission status: Runtime Error

Solution code:
l = map(int, input().split())
a = l[1]
b = l[2]
return max(a+b, a-b, a*b)

Submission status: Runtime Error

Solution code:
(a,b) = input()

lis = [a-b, a*b]

r = a+b

for i in lis:
  if lis[i] > r:
    r = lis[i]
    
return r

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
 for i in range(X - K + 1, X + K):
     if i < X + K - 1:
        print(i, end=' ')
     else:
        print(i)

Submission status: Runtime Error

Solution code:
a = (int(i) for i in input().split()) 
b = a[0] + a[1]
c= a[0] - a[1]
d= a[0] * a[1]

print(max([b,c,d])

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
 for i in range(X - K + 1, X + K):
  if i < X + K - 1:
    print(i, end=' ')
  else:
    print(i)

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
 for i in range(X - K + 1, X + K):
 if i < X + K - 1:
 print(i, end=' ')
 else:
 print(i)

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
 for i in range(X - K + 1, X + K):
    if i < X + K - 1:
 print(i, end=' ')
 else:
 print(i)
 K, X = map(int, input()

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
2 for i in range(X - K + 1, X + K):
3 if i < X + K - 1:
4 print(i, end=' ')
5 else:
6 print(i)
1 K, X = map(int, input()

Submission status: Runtime Error

Solution code:
a, b = input().split()
max(a + b, a - b, a * b)

Submission status: Runtime Error

Solution code:
a, b = input(), input()
max(a + b, a - b, a * b)

Submission status: Runtime Error

Solution code:
num = int(input())
s = ["".join(sorted(input())) for i in range(num)]

d =dict()

for st in s:
    if st in d:
        d[st]+=1
    else:
        d[st]=1

ans=0

for i in d:
    k=d[i]
    ans+=(k*(k-1))//2

print(ans)

Submission status: Runtime Error

Solution code:
input = raw_input
#import numpy as np

N, M = map(int, input().split())

values = [[] for i in range(M+1)]
for i in range(N):
    A, B = map(int, input().split())
    if M >= A:
        values[A].append(B)

#print(values)
out = 0
elms = []
for i in range(1, M+1):
    new_elms = sorted(values[i], reverse=True)[:M-i+1]
    elms += new_elms
    if len(elms) >= 1:
        max_val = max(elms)
        out += max_val
        elms.remove(max_val)

print(out)

Submission status: Runtime Error

Solution code:
import sys
 
def solve(N: int, M: int, P: int, A: "List[int]", B: "List[int]", C: "List[int]"):
    dist = [sys.maxsize] * (N + 1)
 
    dist[1] = 0
    for _ in range(N):
        for j in range(M):
            weight = -(C[j] - P)
            if dist[B[j]] > dist[A[j]] + weight:
                dist[B[j]] = dist[A[j]] + weight
 
    result = -dist[N]
 
    for _ in range(N + 1):
        for j in range(M):
            weight = -(C[j] - P)
            if dist[B[j]] > dist[A[j]] + weight:
                dist[B[j]] = dist[A[j]] + weight
 
    if result != -dist[N]:
        print(-1)
    else:
        print(max(-dist[N], 0))
 
 
# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    P = int(next(tokens))  # type: int
    A = [int()] * (M)  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    C = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
        C[i] = int(next(tokens))
    solve(N, M, P, A, B, C)
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
str = input().split()
plus = str[0] + str[1]
minus = str[0] - str[1]
mul = str[0] * str[1]
if(plus > minus):
  if(plus > mul):
    max = plus
  else:
    max = mul
if(minus > plus):
  if(minus > mul):
    max = minus
  else:
    max = mul
if(plus > minus):
  if(plus > mul):
    max = plus
  else:
    max = mul

Submission status: Runtime Error

Solution code:
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]
 
from collections import Counter
counter = Counter(s)
ans = sum(n*(n-1)//2 for n in counter.values())
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import factorial

num=int(input())
count=0

#for i in range(num):
#    str=input()
#    str=''.join(sorted(str))
#    str = ''.join(sorted(input()))
#    stl.append(str)
stl =[(''.join(sorted(input()))) for i in range(num)]

duplicate=[x for x in set(stl) if stl.count(x) > 1]
if duplicate:
    for dup in duplicate:
        n=stl.count(dup)
        count += factorial(n) // 2 // factorial(n - 2)
    
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
sl = []
for _ in range(n):
    sl.append(input())
rl=[]
ll=[]
rslt=0
for i in range(n):
    r=sorted(sl[i])
    if r in rl: ll[rl.index(r)]+=1; rslt+=ll[rl.index(r)]
    else: rl.append(r); ll.append(0)
print(rslt)

Submission status: Runtime Error

Solution code:
from math import factorial

num=int(input())
stl=[]

count=0

for i in range(num):
    str=input()
    str=''.join(sorted(str))
    stl.append(str)

duplicate=[x for x in set(stl) if stl.count(x) > 1]
if duplicate:
    for dup in duplicate:
        n=stl.count(dup)
        count += factorial(n) // 2 // factorial(n - 2)
    
print(count)

Submission status: Runtime Error

Solution code:
from math import factorial

num=int(input())
stl=[]

count=0

for i in range(num):
    str=input()
    str=''.join(sorted(str))
    stl.append(str)

duplicate=[x for x in set(stl) if stl.count(x) > 1]
if duplicate:
    for dup in duplicate:
        n=stl.count(dup)
        count += factorial(n) // ( factorial(n - 2) * 2 )
    
print(count)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split)

print (max([a+b, a-b, a*b]))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

print (max(a+b, a-b, a*b))

Submission status: Runtime Error

Solution code:
def for_factorial(n):
    val = 1
    for i in range(2, n + 1):
        val *= i
    return int(val/2)
N = int(input())
l = []
_l = [] #並び替えた文字列の格納
_c = 0 #カウントの総合
#1)リストの作成
for i in range(N):
    l.append(input())
#2)文字列の並び替えを"_l"に格納
for s in l:
    one_l = [c for c in s]
    one_l.sort()
    _one_l = "".join(one_l)
    _l.append(_one_l)
#3)アナグラム判定
for s in _l[:]:
    c = _l.count(s)
    if c > 1:
        #cの組み合わせを考える c C 2 
        _c += for_factorial(c)
        _l.remove(s)
print(_c)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll a, b;
  cin >> a >> b;
  cout << max(a + b, max(a - b, a * b)) << endl;
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
K, X = map(int, input().split())
for i in range(X - K + 1, X + K):
if i < X + K - 1:
print(i, end=' ')
else:
print(i)

Submission status: Runtime Error

Solution code:
 K, X = map(int, input().split())
2 for i in range(X - K + 1, X + K):
3 if i < X + K - 1:
4 print(i, end=' ')
5 else:
6 print(i)

Submission status: Runtime Error

Solution code:
def operations(A, B):
  r1 = A+B
  r2 = A-B
  r3 = A*B
  
  if r1>=r2 and r1>=r3:
    return r1
  elif r2>=r1 and r2>=r3:
    return r2
  elif r3>=r1 and r3>=r2:
  	return r3
  
A = input()
B = input()
r = operations(A, B)
print(r)

Submission status: Runtime Error

Solution code:
def add(13, 3):
    print(max([13+3, 13-3, 13*3]))

Submission status: Runtime Error

Solution code:
def operations(A, B):
  r1 = A+B
  r2 = A-B
  r3 = A*B
  
  if r1>=r2 and r1>=r3:
    return r1
  elif r2>=r1 and r2>=r3:
    return r2
  else:
  	return r3
  
A = input()
B = input()
operations(A, B)

Submission status: Runtime Error

Solution code:
A, B = [int(input()) for _ in range(2)]
 
P = A + B
M = A - B
T = A * B
 
lst = [P, M, T]
print(max(lst))

Submission status: Runtime Error

Solution code:
import json


from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n = int(input())
S = list()

A = list()
for _ in range(n):
  S.append(input())

  
  
hash = dict()
for a in range(len(S)):
  for b in range(len(S[a])):
    hash[S[a][b]] = 0

for i in range(len(S)):
  for ssf in hash:
    hash[ssf] = 0
  for j in range(len(S[i])):

    hash[[S[i][j]][0]] += 1

  A.append(hash)

count = 0
ddd = dict()
unique_list = list(map(json.loads, set(map(json.dumps, A))))
ans = 0

for dd in unique_list:
  if A.count(dd) > 1:
    ans += cmb(A.count(dd),2)

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  s.sort()
  S.append(s)
S.sort()
S.append(["z" for i in range(11)])
cont=0
for i in range(n-1):
  t=1
  while S[i]==S[i+t]:
    cont+=1
    t+=1
print(cont)

Submission status: Runtime Error

Solution code:
A, B = [int(input()) for _ in range(2)]
 
P = A + B
M = A - B
T = A * B
 
li = [P, M, T]
print(max(li))

Submission status: Runtime Error

Solution code:
def operations(A, B):
  r1 = A+B
  r2 = A-B
  r3 = A*B
  
  if r1>=r2 and r1>=r3:
    return r1
  elif r2>=r1 and r2>=r3:
    return r2
  else
  	return r3
  
A = input()
B = input()
operations(A, B)