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:
from heapq import heappop,heappush
n,m=map(int,input().split())
work=[set() for _ in range(m+1)]
for _ in range(n):
    a,b=map(int,input().split())
    if a<=m: work[a].add(b)

ans=0
q=[]
for i in range(1,m+1):
    for x in work[i]:
        heappush(q,-x)
    if q!=[]: ans+=heappop(q)
print(-ans)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())

x = A + B
y = A - B
z = A * B

if x > y and x > z:
	answer = x

elif y > x and y >z:
	answer = y

elif z > x and z > y:
	answer = z
    
print(answer)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
X = A + B
Y = A - B
Z = A * B
  if X >= Y and X >= Z:
     print(X)
elif Y >= Z and Y >= X:
     print(Y)
elif Z >= X and Z >= Y:
     print(Z)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
X = A + B
Y = A - B
Z = A * B
  if X >= Y and X >= Z :
     print(X)
elif Y >= Z and Y >= X :
     print(Y)
elif Z >= X and Z >= Y :
     print(Z)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
X = A + B
Y = A - B
Z = A * B
  if X >= Y and X >= Z : print(X)
elif Y >= Z and Y >= X : print(Y)
elif Z >= X and Z >= Y : print(Z)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
X = A + B
Y = A - B
Z = A * B
if X - Y > 0 and X - Z > 0 : print(X)
elif Y - Z > 0 and Y - X > 0 : print(Y)
elif Z - X > 0 and Z - Y > 0 : print(Z)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
X = A + B
Y = A - B
Z = A * B
if X > Y and X > Z : print(X)
elif Y > Z and Y > X : print(Y)
elif Z > X and Z > Y : print(Z)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
X = A + B
Y = A - B
Z = A * B
if X > Y and X > Z : print(X)
if Y > Z and Y > X : print(Y)
if Z > X and Z > Y : print(Z)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
if A*B > A+B|A-B : ans = A*B
if A+B > A-B|A*B : ans = A+B
if A-B > A*B|A+B : ans = A-B
print(ans)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
if A+B < A-B < A*B or A-B < A+B < A*B :ans = A*B
if A*B < A-B < A+B or A-B < A*B < A+B :ans = A+B
if A+B < A*B < A-B or A*B < A+B < A-B :ans = A-B
print(ans)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split)
if A+B < A-B < A*B | A-B < A+B < A*B :ans = A*B
if A*B < A-B < A+B | A-B < A*B < A+B :ans = A+B
if A+B < A*B < A-B | A*B < A+B < A-B :ans = A-B
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if A+B >= A-B and A+B >= A*B:
  print(A+B)
elif A-B >= A+B and A-B >= A*B:
  print(A-B)
else:
  print(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 = int(input().split())
print(max([A+B,A-B,A*B]))

Submission status: Runtime Error

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

x = a + b
y = a - b
z = a*b

if x != y and y != z and x != z:
    if x > y and x > z:
        print(x)
    else:
        if y > z:
            print(y)
        else:
            print(z)
if x == y and y ==  Z and x == Z:
    print(x, y, z)
else:
    pass
if x == y and x != Z:
    if x > z:
        print(x, y)
    else:
        print(z)
else:
    pass
if y == z and y != x:
    if y > x:
        print(y, z)
    else:
        print(x)
else:
    pass
if x == z and x != y:
    if x > y:
        print(x, z)
    else:
        print(z)
else:
    pass

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:
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())
l = []
c = a +b
d = a -b
e = a *b
l.append(c)
l.append(d)
l.append(e)
print(max(l[c, d, e]))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append =c
l.append =d
l.append =e
print(max(l[c, d, e]))

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
l = []
c = a +b
d = a -b
e = a *b
l.append =c
l.append =d
l.append =e
print(max(l))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
A,B = list(map(int,input().split()))
ans=[0]*3
a[0]=A+B
a[1]=A-B
a[2]=A*B
print(max(a))

Submission status: Runtime Error

Solution code:
A,B=input().split();
if B<=0:
    if A+B<=A*B:
        print(A*B);
    else:
        print(A+B);
else:
    if A-B<=A*B:
        print(A*B);
    else:
        print(A-B);

Submission status: Runtime Error

Solution code:
if B<=0:
    if A+B<=A*B:
        print(A*B);
    else:
        print(A+B);
else:
    if A-B<=A*B:
        print(A*B);
    else:
        print(A-B);

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second

typedef long long ll;
typedef pair<int, int> pii;

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
	ios::sync_with_stdio(false); cin.tie(NULL);
	ll a, b; cin >> a >> b;
	cout << max({a+b, a-b, a * b}) << '\n';

	

	return 0;
}

Submission status: Runtime Error

Solution code:
if A == 1 and B == 1:
    print(2)
elif A>0 and B>0 or A<0 and B==0:
    print(A*B)
elif A>=0 and B<0 or A==0 and B<0:
    print(A-B)
else:
    print(A+B)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

x=a+b
y=a-b
z=a*b

print(max(x,y,z))

Submission status: Runtime Error

Solution code:
a,b=input()

x=a+b
y=a-b
z=a*b

print(max(x,y,z))

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().strip())

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

Submission status: Runtime Error

Solution code:

import sys

def log(*args, **kwargs):
    print(*args, **kwargs, file=sys.stderr)

log("hogehoge")

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())

c=a+ba
d=a-b
e=a*b
f=[c,d,e]
print(max(f))

Submission status: Runtime Error

Solution code:
def LI():
  return [int(s) for s in input().split()]

A,B = LI()

print(max(A+B,A-B,int(A*B))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

_sum = A + B
_sub = A - B
_mul = A * B

_list = [_sum,_sub,_mul]

print(max(_list))

Submission status: Runtime Error

Solution code:
from sys import stdin

a,b = [int(x) for x in stdin.readline().rstrip().split()]

arr =[]

arr.append(a+b)
arr.append(a-b)
arr.append(a*b)

print(arr.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:
a,b=map(int,input().split())
a,b= (input(a+b),input(a-b),input(a*b))
max()

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
c = A + B
d = A - B
e = A * B
f = [c, d, e]
maxvalue = c
for i in range(len(f)):
    if f[i] > maxvalue:
        maxvalue = f[i]
print(maxvalue)

Submission status: Runtime Error

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


if a+b >=  a-b and a+b >= a*b:
    print(a+b)

elif a-b >= a+b and a-b >= a*b:
    print(a-b)

elif a*b >= a+b and a*b >= a-b:
    print(a*b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
strings=list("".join(sorted(input())) for _ in range(N))
string_set = set()
counts = {}
count = 0
for string in strings:
    if string in string_set:
        count += counts[string]
        counts[string] += 1
    else:
        counts[string] = 1

print(count)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
N=int(input())
strings=list("".join(sorted(input())) for _ in range(N))
count = 0
for string in strings:
    tmp = strings.count(string)
    if tmp > 1:
        count += (tmp - 1) / 2

print(int(count))

Submission status: Runtime Error

Solution code:
import itertools
def compareLists(string1, string2):
    result = 1
    list1 = sorted(string1)
    list2 = sorted(string2)
    if list1 != list2:
        result = 0
    return result

N = int(input())
list_s = []
list_for_dic = []

for _ in range(N):
    s = input()
    list_s.append(s)
    
list_comparisions = list(itertools.combinations(list_s, 2))
score = 0
for compare in list_comparisions:
    score += compareLists(compare[0], compare[1])
    
print(score)

Submission status: Runtime Error

Solution code:
import itertools
def compareLists(string1, string2):
    result = 1
    list1 = sorted(string1)
    list2 = sorted(string2)
    if list1 != list2:
        result = 0
    return result

N = int(input())
list_s = []
list_for_dic = []

for _ in range(N):
    s = input()
    list_s.append(s)
    
score = 0
for compare in list_comparisions:
    score += compareLists(compare[0], compare[1])

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
wa = a + b
sa = a - b
seki = a * b
if wa > sa and wa > seki:
    print(wa)
    break
elif sa > wa and sa > seki:
    print(sa)
    break
else:
    print(seki)

Submission status: Runtime Error

Solution code:
list = input().split()
a = int(list[0])
b = int(list[1])
ans = a+b
ans_2 = a-b
ans_3 = a*b
if ans_2>ans:
    ans = ans_
if ans_3>ans:
    ans = ans_3
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:
a=int(input())
b=int(input())

c=a+b
if a-b>c:
    c=a-b
if a*b>c:
    c=a*b
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
data = list(map(int,input().sprit()))
add = data[0] + data[1]
sub = data[0] - data[1]
mul = data[0] * data[1]
result = [add,sub,mul]
ans = add
if sub > ans:
  ans = sub
if mul > ans:
  ans = mul
return ans

Submission status: Runtime Error

Solution code:
A, B = map(int, 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)

elif(z>x and z>y):
    print(z)

else:
    exit()
~

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A,B = map(int,input(),split())
a = A+B
b = A-B
c = A*B
abc = [a,b,c]
max(abc)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
d = 0
e = 0
for i in range(n):
    s = sorted(list(input()))
    a.append(s)
a.sort()
f = []
for b in a:
    if b in f:
        d += 1
    f.append(b)
print(d)

Submission status: Runtime Error

Solution code:
a,b = open(0)
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,a/b))

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

A-B = b-a
A-C = c-a
A-D = d-a
A-E = e-a
B-C = c-b
B-D = d-b
B-E = e-b
C-D = d-c
C-E = e-c
D-E = e-d

if (A-B > k) or (A-C > k) or (A-D > k) or (A-E > k) or (B-C > k) or (B-E > k) or (C-D > k) or (C-E > k) or (D-E > k):
    print(":(")
else:
    print("Yay!")

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

LIST = [C,D,E]

print(max(LIST))

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(A*B)

print(max(C,D,E))

Submission status: Runtime Error

Solution code:
import numpy
A, B = map(int, input().split())

C = print(A+B)
D = print(A-B)
E = print(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:
import numpy
A, B = map(int, input().split())

C = print(A + B)
D = print(A - B)
E = print(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, B = map(int, input().split())

AprasuB = print(A + B)
AmainasuB = print(A - B)
AkakeruB = print(A*B)

if AmainasuB > AprasuB and AmainasuB > AkakeruB:
    print(AmainasuB) 
elif AprasuB > AmainasuB and AprasuB > AkakeruB:
    print(AprasuB)
elif AkakeruB > AmainasuB and AkakeruB > AprasuB:
    print(AkakeruB)

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
if a+b>=a-b and a+b>=a*b:
  print(a+b)
elif a-b>=a+b and a-b>=a*b:
  print(a-b)
else:
  print(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:
a, b=map(int, input().split())
print(max[a+b, a-b, a*b])

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 sys
input = sys.stdin.readline
def print_ans(A, B):
    """Test Case
    >>> print_ans(-13, 3)
    -10
    >>> print_ans(1, -33)
    34
    >>> print_ans(13, 3)
    39
    """
    print(max(max(A + B, A - B), A * B))

if __name__ == '__main__':
    A = int(input().rstrip())
    B = int(input().rstrip())
    print_ans(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:
A=int(input())
B=int(input())
if (A+B)>(A-B) and (A+B)>(A*B):
  print(A+B)
elif (A-B)>(A+B) and (A-B)>(A*B):
  print(A-B)
else (A*B)>(A+B) and (A*B)>(A-B):
  print(A*B)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
S={}
for _ in range(N):
  s = ''.join(sorted(input().rstrip()))
  if s in S:
    S[s] += 1
  else:
    S[s] = 1

ans=0
for s in S.values():
  ans += s*(s-1)//2
  
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
l = []
l.append(a+b)
l.append(a-b)
l.appned(a*b)
print(max(a))

Submission status: Runtime Error

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

rist = [ A+B , A-B , A*B]

print(max(rist))

Submission status: Runtime Error

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

rist = [ A+B , A-B , A*B]

rist.sort()
print(rist[3])

Submission status: Runtime Error

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

rist = [ A+B , A-B , A*B]

rist.sort()

print(rist[3])

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 = list(map(int, input().split()))
a = n[0]
b = n[1]

ab1 = a + b
ab2 = a - b
ab3 = a * b

print(int(max(ab1, ab2, ba3))

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
add = a + b
sub = a - b
mul = a * b
callist = [add, sub, mul]
print(max(callist))

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);
# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";

string vow = "aeiou";

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

const int dx[] = { -1 , 0 , 0 , 1 } ;
const int dy[] = { 0 , -1 , 1 , 0 } ;

const ld pie = 3.14159265358979 ;
const ll mod = 1e9 + 7 ;

void solve ( int test_case )
{
    int a , b ; 
    cin >> a >> b ; 
    
    int ans = max ( { a + b , a-b , a*b } ) ;
    cout << ans ; 
}

int main()
{
    int t = 1;
    //cin >> t;

    for ( int i=0 ; i < t ; i++ ) solve(i);
    return 0;
}

Submission status: Runtime Error

Solution code:
from functools import lru_cache

n = int(input())
list1 = [''.join(sorted(input())) for i in range(n)]
dict1 = dict()
cout = 0
@lru_cache(maxsize = None)
def func(s):
	if s == 2:
		return 1 #2個の場合は1パターン
	return s-1 + func(s-1)

for i in range(n):
	if list1[i] in dict1:
		dict1[list1[i]] += 1
	else:
		dict1[list1[i]] = 1

for i in dict1:
	if dict1[i] != 1:
		cout += func(dict1[i])

print(cout)

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 19,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

A,B=map(int,readline())

print(max({A * B, A + B, A - B}))

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 = int(input())
b = int(input())
print(max(a+b, a-b, a*b))

Submission status: Runtime Error

Solution code:
num = input().split(" ")
a = int(num[0])
b = int(num[1])
return 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:
a=int(input())
b=int(input())
print(max(a+b,max(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:
A=int(input())
B=int(input())

a = A + B
b = A - B
C = A * B
number = [a,b,c]
print(max(number))

Submission status: Runtime Error

Solution code:
n,m,p=map(int,input().split())
A=[]
for i in range(m):
    a,b,c=map(int,input().split())
    A.append((a,b,c-p))

def BellmanFord(edges,num_v,source):
    #グラフの初期化
    inf=float("inf")
    dist=[-inf for i in range(num_v)]
    dist[source-1]=0
  
    #辺の緩和
    buf=0
    for i in range(num_v*2):
        for edge in edges:
            if dist[edge[1]-1] < dist[edge[0]-1] + edge[2]:
                dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
                if i>=num_v:
                    dist[edge[1]-1] =inf
        if i==num_v-1:
            buf=dist[-1]
    if dist[-1]!=buf or dist[-1]==-inf:
        return -1
    return max(dist[-1],0)

x=BellmanFord(A,n,1)
print(x)

Submission status: Runtime Error

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

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

if a > 0:
  if b > 0:
    print(list[2])
  else:
    print(list[1])

else:
  if b > 0:
    print(list[0])
  else:
    print(list[2])

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
p = int(A + B)
m = int(A - B)
c = int(A * B)
s = [p,m,c]
max(s)

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().split())

s = A + B
d = A - B
m = A * B

print(max(s, d, m))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
if B >= 0:
    if (A+B)>=(A*B):
        print(A+B)
    else:
        print(A*B)
else:
    if (A-B)>=(A*B):
        print(A-B)
    else:
        print(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())
number1=A+B
number2=A-B
number3=A*B
print(max([number1,number2,number3]))

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()),int(input())
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:
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())

pla = A + B
sub = A - B
by  = A * B

if pla >= sub and pla >= by:
  priny(pla)
elif sub >= pla and sub >= by:
  print(sub)
elif by >= pla and by >= sub:
  print(by)

Submission status: Runtime Error

Solution code:
A , B = map(int, input().split())

pla = A + B
sub = A - B
by  = A * B

if pla > sub and pla > by:
  priny(pla)
elif sub > pla and sub > by:
  print(sub)
elif by > pla and by > sub:
  print(by)

Submission status: Runtime Error

Solution code:
a = int(input())
s = input()
    if a >= 3200:
        print(s)
    else:
        print("red")

Submission status: Runtime Error

Solution code:
A,B=input().split()
A=int(A)
B=int(B)

p=A+B
m=A-B
a=A*B

if p>=m and p>=a:
    print(p)
else if m>=p and m>=a:
    print(m)
else:
    print(a)

Submission status: Runtime Error

Solution code:
A=input()

B=input()


ad=int(A)+int(B)
mi=int(A)-int(B)
de=int(A)*int(B)

math=[ad,mi,de]
m_max=max(math)

print(m_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 = int(input())
B = int(input())

print(max([A+B, A-B, A*B]))

Submission status: Runtime Error

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

result = A + B
if A - B > result:
  result = A - B
if A * B > result:
  result = A * B
print(result)

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())
c = a+b
d = a-b
e = a*b
print(max(c,d,e))

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:
A = int(input())
B = int(input())
n = A*B
if n < A-B:
    n = A-B
if n < A+B:
    n = A+B
print(n)

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
n= A*B
if n < A-B:
   n= A-B
if n < A+B:
    n= A+B
print(n)

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split(' '))

answers = [A+B, A-B, A*B, A/B]
print(max(answers))

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().split())
m = a + b
m = m < a - b if m = a - b else m
m = m < a * b if m = a * b else m
print(m)

Submission status: Runtime Error

Solution code:
def dd():
    a=int(input("a="));
    b=int(input("b="));
    if(a+b>a-b):
        if(a+b>a*b):
            print(a+b);
        
        else:
            print(a*b);
    else:
        if(a-b>a+b):
            if(a-b>a*b):
              print(a-b);
            else:
                print(a*b);
def main():
    dd();
main();

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

largest = -1000000

for i in range(3):
  if answers[i]>largest:
    largest = answers[i]
    
print(largest)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A=int(input())
B=int(input())
Sum = A + B
Minus = A - B
Multi = A * B
if Sum > Minus and Sum > Multi:
    print(Sum)
elif Multi > Minus and Sum < Multi:
    print(Multi)
else:
    print(Minus)

Submission status: Runtime Error

Solution code:
"""#自分で考えたやつ
N, M = map(int, input().split())
AB = []
for i in range(N):
    a, b =  (int(x) for x in input().split())
    AB.append([a, b])
AB.sort(key=lambda x: x[1])

dic = {}
for i in range(M):
"""

import heapq

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

# 仕事の制約が厳しい順にリストに格納する
Blist = [[] for _ in range(M)]
for i in range(N):
    A, B = map(int, input().split())
    if A <= M: # AがMより大きいといつやっても間に合わない
        Blist[A-1].append(-B) # heapdを使うことを考慮して-倍しておく

ans = 0
q = [] # heapd.heapify(q)でリストのヒープ化ができるがここではlen(q)を使いたいためにしないでおく

# 可能な仕事をqに入れて扱う。その中でもBが最大(「-」倍しているのでここでは最小)のものを優先して取り出す。
for i in range(M):
    for b in Blist[i]: # ヒープ化されたリストqに2次元のBlistのi番目のリストの要素を全て入れる
        heapq.heappush(q, b)
    if len(q) > 0: # qに要素があるならば、qから最小の要素を取り出して(「-」倍してあるので)それを引き算する
        ans -= heapq.heappop(q)

print(ans)

Submission status: Runtime Error

Solution code:
"""#自分で考えたやつ
N, M = map(int, input().split())
AB = []
for i in range(N):
    a, b =  (int(x) for x in input().split())
    AB.append([a, b])
AB.sort(key=lambda x: x[1])

dic = {}
for i in range(M):
"""

import heapd

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

# 仕事の制約が厳しい順にリストに格納する
Blist = [[] for _ in range(M)]
for i in range(N):
    A, B = map(int, input().split())
    if A <= M: # AがMより大きいといつやっても間に合わない
        Blist[A-1].append(-B) # heapdを使うことを考慮して-倍しておく

ans = 0
q = [] # heapd.heapify(q)でリストのヒープ化ができるがここではlen(q)を使いたいためにしないでおく

# 可能な仕事をqに入れて扱う。その中でもBが最大(「-」倍しているのでここでは最小)のものを優先して取り出す。
for  i in range(M):
    for b in Blist[i]: # ヒープ化されたリストqに2次元のBlistのi番目のリストの要素を全て入れる
        heapd.heappush(q, b)
    if len(q) > 0: # qに要素があるならば、qから最小の要素を取り出して(「-」倍してあるので)それを引き算する
        ans -= heapd.heappop(q)

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(s))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)

Submission status: Runtime Error

Solution code:
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(a))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input().split()
a, b = s[0], s[1]
x = [a+b, a-b, a*b]
print(max(x))