Harryxun/stf_run huggingface dataset:
import random
random.seed(0)

D = int(input())
C = [int(i) for i in input().split()]
S = [[int(i) for i in input().split()] for j in range(D)]

def score_calc(T):
    total = 0
    last = [0] * 26
    for i in range(1, D+1):
        t = T[i]
        total += S[i-1][t-1]
        last[t-1] = i
        for j in range(26):
            total -= C[j] * (i - last[j])
    return total
    
N = 100
T_ls = [[random.randint(1, 26) for i in range(D)] for j in range(N)]
best_score = 0
ans = []
for i in range(N):
    if score_calc(T_ls[i]) > best_score:
        best_score = score_calc(T_ls[i])
        ans = T_ls[i]

for i in range(D):
    print(ans[i])

### FIXED CODE ###

D = int(input())
C = [int(i) for i in input().split()]
S = [[int(i) for i in input().split()] for j in range(D)]

total = 0
last = [0] * 26
ans = []
for i in range(1, D+1):
    score = [0] * 26
    for t in range(26):
        score[t] += S[i-1][t-1]
        for j in range(26):
            if j != t:
                score[t] -= C[j] * (i - last[j])
    total += max(score)
    last[score.index(max(score))] = i
    ans.append(score.index(max(score))+1)

for i in range(D):
    print(ans[i])
x = int(input())
if x == 1:
    print(x)
else:
    n = 1
    for i in range(1,32):
        for j in range(2,10):
            m = i**j
            if m <= x and m > n:
                n = m
print(n)

### FIXED CODE ###

a, b, c, d = map(int, input().split())
if abs(c-a) <= d:
    print('Yes')
elif abs(b-a) <= d and abs(c-b) <= d:
    print('Yes')
else:
    print('No')
a,b = map(int,  for in input().split())
if a > b:
	print(“a > b”)
elif a < b:
	print(“a < b”)
else:
	print(“a == b”)
 


### FIXED CODE ###

a,b = map(int, input().split())
if a > b:
 print("a > b")
elif a < b:
 print("a < b")
else:
 print("a == b")
import math
import itertools

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def main():
    a, b = map(int, input().split())
    k = []
    for i in make_divisors(a):
        if i > b:
            break
        elif b % i == 0:
            k.append(i)
    count = 0
    for i in itertools.product([0,1], repeat=len(k)):
        if i.count(1) < 1:
            continue
        l = [k[j[0]] for j in enumerate(i) if j[1] == 1]
        for x, y in itertools.combinations(l, 2):
            if math.gcd(x, y) != 1:
                break
        else:
            count = max(count, len(l))
    print(count)
                
if __name__ == '__main__':
    main()

### FIXED CODE ###

from functools import lru_cache

def main():
    a,b=map(lambda x: set(prime_factorize(int(x))),input().split())
    print(len(a&b)+1)

@lru_cache(maxsize=None)
def primes(n:int) -> list:
    '''n以下の全素数をlistで返す'''
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

# 素数判定（単純な素数判定なら十分早い。大量にやる場合はX in primesがよさそう）
@lru_cache(maxsize=None)
def is_prime(n: int) -> bool:
    '''引数nが素数であればTrue、そうでなければFalseを返す'''
    if n == 1:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False
    
    for i in range(3, int(n**0.5)+1, 2):
        if n % i == 0:
            return False
    return True

# 素因数分解
@lru_cache(maxsize=None)
def prime_factorize(n: int) -> list:
    '''引数nの素因数分解結果のlistを返す。'''
    arr = []
    # 2で割り続け奇数まで還元する
    while n % 2 == 0:
        arr.append(2)
        n //= 2
    # sqrt(n)までの素数で試し割
    for f in primes(int(n**0.5)):
        while n % f == 0:
            arr.append(f)
            n //= f
    if n != 1:
        arr.append(n)
    return arr

#約数リスト
def make_divisors(n: int) -> list:
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
        
if __name__ == "__main__":
    main()
N = int(input())
As = list(map(int, input().split()))

res = [0] * N
for idx, ai in zip(np.arange(N-1, -1, -1), As[::-1]):
    oe = sum([res[i] for i in range(idx, N, idx+1)]) % 2#
    res[idx] = ai ^ oe

print(sum(res))
idxs = []
for i, val in enumerate(res):
    if val:
        idxs += [i + 1]
print(*idxs)

### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))

res = [0] * N
for idx, ai in zip(range(N-1, -1, -1), As[::-1]):
    oe = sum([res[i] for i in range(idx, N, idx+1)]) % 2#
    res[idx] = ai ^ oe

print(sum(res))
idxs = []
for i, val in enumerate(res):
    if val:
        idxs += [i + 1]
print(*idxs)
S = input()
if S = "AAA" or "BBB":
    print("No")
else:
    print("Yes")

### FIXED CODE ###

S = input()
if S == "AAA" or S == "BBB":
    print("No")
else:
    print("Yes")
n,m = list(map(int, input().split()))
a = list(map(int, input().split()))

a.sort()
table = {1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}

dp = ["" for i in range(n + 1)]
for x in a:
    dp[table[x]] = str(x)

def comp(a, b):
    len_a = len(a)
    len_b = len(b)
    if len_a < len_b:
        return b
    if len_a > len_b:
        return a
    #  len_a == len_b
    for i in range(len_a):
        tmp_a = a[i]
        tmp_b = b[i]
        if tmp_a < tmp_b:
            return b
        if tmp_a > tmp_b:
            return a
    # a == b
    return a

for i in range(1, n + 1):
    for x in a:
        tmpstr = str(x)
        tmprest = i - table[x]
        if tmprest < 0:
            tmpstr = ""
        if 0 <= tmprest:
            # load dp
            tmp = dp[tmprest]
            if tmp == "":
                tmpstr = ""
            else:
                tmpstr = tmp + str(x)
        dp[i] = comp(dp[i], tmpstr)

print(dp[-1])


### FIXED CODE ###

n,m = list(map(int, input().split()))
a = list(map(int, input().split()))

# n,m = [2, 9]
# a = [1, 2, 3, 4, 5, 6, 7, 8, 9]

a.sort()
table = {1:2,2:5,3:5,4:4,5:5,6:6,7:3,8:7,9:6}

dp = ["" for i in range(max(n + 1, m+1))]
for x in a:
    dp[table[x]] = str(x)


def str_max(maxstrs):
    maxstrlen = max(map(lambda x:len(x), maxstrs))
    maxstr = max(filter(lambda x:len(x) == maxstrlen, maxstrs))
    return maxstr


for i in range(n + 1):
    for x in a:
        tmpstr = str(x)
        tmprest = i - table[x]
        if tmprest < 0:
            tmpstr = ""
        if 0 <= tmprest:
            # load dp
            tmp = dp[tmprest]
            if tmp == "":
                tmpstr = ""
            else:
                tmpstr = tmp + str(x)
        dp[i] = str_max([dp[i], tmpstr])

print(dp[n])
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;cin>>a>>b>>c;
	if(b-a==c-b)cout<<"YES";
	else cout<<"NO";
	return 0;
}

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
print ['NO', 'YES'][b - a == c - b]
# -*- coding: utf-8 -*-
a, b, c = map(int, raw_input().split())
print(int(b/c)-int(a/c+0.999)+1)

### FIXED CODE ###

a, b, c = map(int, input().split())
print(int(b/c)-int(a/c+0.999)+1)
s = input()

s[3] = "8"
print(s)

### FIXED CODE ###

s = input().replace("2017", "2018")
print(s)
X=int(input())
list=[]
for i in range(1, X):
  for j in range(2, X):
    if (i**j)<=X:
      list.append(i**j)
print(max(list))

### FIXED CODE ###

X=int(input())
list=[1]
for i in range(1, X):
  for j in range(2, X):
    if (i**j)<=X:
      list.append(i**j)
    else:break
print(max(list))
import sys
 
def solve(A: int, B: int, N: int):
    x = min(B - 1, N)
    print(A * x // B)
 
 
    return
 
 
# Generated by 1.1.6 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()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)
 
if __name__ == '__main__':
    main()
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, N: int):
    if B > N:
        x = N
    else:
        x = B - 1
    print(A * x // B)


    return


# Generated by 1.1.6 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()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()
提出情報

### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(A: int, B: int, N: int):
    if B > N:
        x = N
    else:
        x = B - 1
    print(A * x // B)


    return


# Generated by 1.1.6 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()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    solve(A, B, N)

if __name__ == '__main__':
    main()
n,a,b = list(map(int, input().split()))
taxi = n*a
densya = n*b
print(np.min([taxi, densya]))

### FIXED CODE ###

n,a,b=map(int, input().split())
print(min(n*a, b))
n=int(input())
from math import gcd
from collections import defaultdict
abd=defaultdict(int)
mod=10**9+7
ab=[]
wzero=0
azero=0
bzero=0
for i in range(n):
    a,b=map(int,input().split())
    if a==0 and b==0:
        wzero+=1
        continue
    elif a==0 and b!=0:
        azero+=1
        continue
    elif a!=0 and b==0:
        bzero+=1
        continue
    x=gcd(a,b)
    a//=x
    b//=x
    ab.append((a,b))
    abd[(a,b)]+=1

n-=(wzero+azero+bzero)
kumid=defaultdict(int)
for i in range(n):
    a,b=ab[i]
    cnt=abd[(-b,a)]+abd[(b,-a)]
    kumid[cnt]+=1
maxkey=max(kumid.keys())
ans=1

for i in range(maxkey,1,-1):
    if kumid[i]!=0:
        j=kumid[i]
        kumid[j]-=i
        tmp=2**i+2**j-1
        ans*=(tmp%mod)
        ans%=mod
#print(kumid)
ans*=(kumid[1]+1)
ans%=mod
ans*=2**kumid[0]%mod
ans%=mod
ans*=(2**azero+2**bzero-1)%mod
ans%=mod
ans+=wzero
ans=(ans+mod-1)%mod
print(ans)

### FIXED CODE ###

from math import gcd
from collections import defaultdict

n=int(input())
abd=defaultdict(int)
mod=10**9+7
wzero=0
azero=0
bzero=0
for i in range(n):
    a,b=map(int,input().split())
    if a==0 and b==0:
        wzero+=1
    elif a==0 and b!=0:
        azero+=1
    elif a!=0 and b==0:
        bzero+=1
    else:
        g=gcd(a,b)
        a=a//g
        b=b//g
        abd[(a,b)]+=1

liskey=list(abd.keys())
ans=1
for k in liskey:
    if abd[k] != 0:
        a,b=k
        x=abd[(a,b)]+abd[(-a,-b)]
        y=abd[(-b,a)]+abd[(b,-a)]
        abd[(a,b)]=0
        abd[(-a,-b)]=0
        abd[(-b,a)]=0
        abd[(b,-a)]=0
        ans*=(2**x+2**y-1+mod)%mod
        ans%=mod

ans*=(2**azero+2**bzero-1)
ans%=mod
ans=(ans+wzero)%mod
ans=(ans+mod-1)%mod
print(ans)
h, w = map(int, raw_input().split())
for i in range(h):
    row = raw_input()
    print(row)
    print(row)


### FIXED CODE ###

h, w = map(int, raw_input().split())
for i in range(h):
    row = raw_input()
    print(row)
    print(row)
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int ans, b;
    cin >> ans;
    for(int i = 1; i < n; ++i){
        cin >> b;
        ans = __gcd(ans,b);
    }
    cout << ans << endl;
}

### FIXED CODE ###

from fractions import gcd
from functools import reduce

n = int(input())
a = list(map(int, input().split()))

print(reduce(gcd, a))
s = list(input())
t = list(input())

def f(s, t):
  s.sort()
  t.sort(reverse=True)

  for i in range(len(s)):
    if s[i] < t[i]:
      return 'Yes'
    elif s[i] > t[i]:
      return 'No'
    elif i + 1 >= len(s) and not i + 1 >= len(t):
      return 'Yes'
  return 'No'

print(f(s, t))

### FIXED CODE ###

s = list(input())
t = list(input())
 
def f(s, t):
  s.sort()
  t.sort(reverse=True)
  s_sum = 0
  t_sum = 0
  for i in range(len(s)):
    s[i] = ord(s[i])
  
  for i in range(len(t)):
    t[i] = ord(t[i])
  
  for i in range(len(s)):
    if not i + 1 >= len(t):
      s_sum += s[i]
      t_sum += t[i]

      if s_sum < t_sum:
        return 'Yes'
      elif s_sum > t_sum:
        return 'No'
    else:
      break

  if len(s) < len(t):
    return 'Yes'
  else:
    return 'No'

print(f(s, t))
n = int(input())
if !n%2:
    n += 1

result = 0

for i in range(1,n+2,2):
    print(i)
    cnt = 0

    for ii in range(1,i+2,2):
        if i%ii == 0:
            cnt += 1

    if cnt >= 8:
        result += 1

print(result)

### FIXED CODE ###

n = int(input())
if not n%2:
    n -= 1

result = 0

for i in range(1,n+2,2):
    cnt = 0

    for ii in range(1,i+2,2):
        if i%ii == 0:
            cnt += 1

    if cnt >= 8:
        result += 1

print(result)
#import itertools
list1=[k for k in input()]
print(list1)
num1=len(list1)
print(num1)
list00=[format(int(k), 'b') for k in range(2**(num1-1))]
print(list00)

list0=['','+']

list01=[]
for count1 in range(num1):
  x=list00[count1]
  list01.extend(x)
print(list01)
total=0

for step1 in range(2):
  for step2 in range(2):
    list2=[list0[step2],list0[step1]]
    num = min(len(list1), len(list2))
    result = [None]*(num*2)
    result[::2] = list1[:num]
    result[1::2] = list2[:num]
    result.extend(list1[num:])
    result.extend(list2[num:])
    result1 = ''.join(result)
    print(result1)
    total+=eval(result1)

print(total)
#176

### FIXED CODE ###

import itertools
s=input()
length=len(s)

ans=0
mylist=list(itertools.product('01',repeat=length-1))

for j in range(len(mylist)):
    tmp=s[0]
    for i in range(length-1):
        if mylist[j][i]=='1':
            tmp+="+"+s[i+1]
        else:
            tmp+=s[i+1]
    tmp=eval(tmp)
    ans+=tmp
print(ans)
n = int(input())
a = list(map(int, input().split()))
ans = 0
now = 1
for i in a:
    if i == now:
        now += 1
print(-1 if now == 1 else n - now + 1)
index197511@index197511-VirtualBox:~/comp

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 0
now = 1
for i in a:
    if i == now:
        now += 1
print(-1 if now == 1 else n - now + 1)
n,q = map(int, input().split())
tree = [set() for i in range(n+1)]
for _ in range(n-1):
  a,b = map(int, input().split())
  tree[a].add(b)
  tree[b].add(a)
lazy = [0]*(n+1)
ans = [0]*(n+1)
cnt = 0

for _ in range(q):
  x,v = map(int, input().split())
  lazy[x] += v

def dfs(v,p,tree):
  ans[v] += lazy[v]
  for x in tree[x]:
    if x == p:
      continue
    lazy[x] += lazy[v]
    dfs(x,v,tree)
  lazy[v] = 0
  return

dfs(1,0,tree)

print(" ".join(map(str,ans[1:])))

### FIXED CODE ###

n,q = map(int, input().split())
tree = [set() for i in range(n+1)]
for _ in range(n-1):
  a,b = map(int, input().split())
  tree[a].add(b)
  tree[b].add(a)
lazy = [0]*(n+1)
cnt = 0

for _ in range(q):
  x,v = map(int, input().split())
  lazy[x] += v

que = [(1,0)]
while que:
  v,p = que.pop()
  for x in tree[v]:
    if x == p:
      continue
    lazy[x] += lazy[v]
    que.append((x,v))

print(" ".join(map(str,lazy[1:])))
def main():
    N = int(input())

    ans1 = AC1(N)
    ans2 = AC2(N)
    assert ans1 == ans2

    print(ans1)


def AC1(N):
    for i in range(N, 999+1):
        if len(set(list(str(i)))) == 1:
            return i


def AC2(N):
    for i in range(1, 9+1):
        if N >= 111 * i:
            return 111 * i


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())

    for i in range(N, 999+1):
        if len(set(list(str(i)))) == 1:
            print(i)
            return


if __name__ == '__main__':
    main()
def odd():
    n = 1
    while True:
        n = n + 2
        yield n


def divisible(n):
    return lambda x: x % n > 0


def primes():
    yield 2
    it = odd()
    while True:
        n = next(it)
        yield n
        it = filter(divisible(n), it)


count = 1
a, b = input().split(" ", 1)
a, b = int(a), int(b)
for x in primes():
    flag1 = 0
    flag2 = 0
    if x > a or x > b:
        break
    while a % x == 0:
        a /= x
        flag1 = 1
    while b % x == 0:
        b /= x
        flag2 = 1
    if flag1 == 1 and flag2 == 1:
        count += 1
print(count)

### FIXED CODE ###

def primes(n):
    i = 2
    prime = []
    while i**2<= n:
        if n % i:
            i += 1
        else:
            n =n//i
            prime.append(i)
    if n > 1:
        prime.append(n)
    return prime
a,b=map(int,input().split())
pa=set(primes(a))
pb=set(primes(b))
inte=pa.intersection(pb)
print(len(inte)+1)
_=input()
A=list(map(int,input().split()))
B=list(set(A))
ans=-1
B=sorted(B)[::-1]
for i in B:
  if A.count(i) >=4:
    print(i**2)
  else:
    A.count(i) >= 2:
      if ans==-1:
        ans=i
      else:
        print(ans*i)
        exit()
print(0)

### FIXED CODE ###

from collections import Counter
n=int(input())
A=list(map(int,input().split()))
A=Counter(A)

S=[]
for i,j in A.items():
  if j>=2:
    S.append(i)
S=list(set(S))
S.sort()
if len(S)>=2:
  ans=S[-1]*S[-2]
else:
  print(0)
  exit()

Q=[]

for i,j in A.items():
  if j>=4:
    Q.append(i)
if Q==[]:
  print(ans)
  exit()
print(max(ans, (max(Q))**2))
a =map(int,input())
s=0
for i in range(a+1):
    s+=i
print(s)

### FIXED CODE ###

a =int(input())
s=0
for i in range(a+1):
    s+=i
print(s)
A, B, K = map(int, input().split())

A_after = A - K

if A < K:
  B_after = B - (K - A)
  A_after = 0
  
print(A_after, B_after)

### FIXED CODE ###

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

A_after = 0
B_after = 0

if A - K >= 0:
  A_after = A - K
  B_after = B

elif A + B - K >= 0:
  B_after = B - (K - A)
  
print(A_after, B_after)
S = input()
if A == B and C == D and A != C:
  print('Yes')
elif A == C and B == D and A != B:
  print('Yes')
elif A == D and B == C and A != B:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S = input()
A = S[0]
B = S[1]
C = S[2]
D = S[3]
if A == B and C == D and A != C:
  print('Yes')
elif A == C and B == D and A != B:
  print('Yes')
elif A == D and B == C and A != B:
  print('Yes')
else:
  print('No')
def f(x,i,n):
    sadness = 0
    for j in range(n):
        sadness += abs(x[j]-i)
    return(sadness)
N = int(input())
H = [int(i) for i in input().split()]
for i in range(N):
    H[i] -= i+1
H = sorted(H)
k = N // 2
print(min(f(H,H[k-1],N),f(H,H[k],N),f(H,H[k+1],N)))


### FIXED CODE ###

def f(x,i,n):
    sadness = 0
    for j in range(n):
        sadness += abs(x[j]-i)
    return(sadness)
N = int(input())
H = [int(i) for i in input().split()]
for i in range(N):
    H[i] -= i+1
H = sorted(H)
k = N // 2
if N == 1 :
    print(0)
else:
    print(f(H,H[k],N))
S = input()
S.replace()

ans = []

for i in range(1,len(s)):
    ans.append("x")

print("".join(ans))

### FIXED CODE ###

S = input()
ans = []

for i in range(len(S)):
    ans.append("x")

print("".join(ans))
n,m = map(int,input().split())
x_lst = list(map(int,input().split()))
x_lst.sort()

if m==1:
    print(0)
else:
    remainder_lst = []
    for i in range(m-1):
        x1 = x_lst[i]
        x2 = x_lst[i+1]

        remainder = x2 - x1
        remainder_lst.append(remainder)

    remainder1_lst = sorted(remainder_lst, reverse=True)
    delete = 0

    if n==1:
        answer = sum(remainder_lst)
    else:
        for i in range(n-1):
            remainder1 = remainder1_lst[i]
            delete += remainder1
        answer = sum(remainder_lst) - delete

    print(answer)

### FIXED CODE ###

n,m = map(int,input().split())
x_lst = list(map(int,input().split()))
x_lst.sort()

if n>=m:
    answer = 0
else:
    remainder_lst = []
    for i in range(m-1):
        x1 = x_lst[i]
        x2 = x_lst[i+1]

        remainder = x2 - x1
        remainder_lst.append(remainder)

    remainder1_lst = sorted(remainder_lst, reverse=True)
    delete = 0

    for i in range(n-1):
        remainder1 = remainder1_lst[i]
        delete += remainder1
    answer =  sum(remainder_lst) - delete

print(answer)
import sys


sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def factorization(N):
    d = {}
    for n in range(2, N + 1):
        tmp = n
        for i in range(2, int(n ** 0.5) + 1):
            if tmp % i == 0:
                cnt = 0
                while tmp % i == 0:
                    cnt += 1
                    tmp //= i
                if i not in d:
                    d[i] = cnt
                else:
                    d[i] += cnt

        if tmp != 1:
            if tmp not in d:
                d[tmp] = 1
            else:
                d[tmp] += 1

    return d


def main():
    N = int(input())
    d = factorization(N)
    d = [v for k, v in d.items() if v > 1]
    cnt = {2: 0, 4: 0, 14: 0, 24: 0, 74: 0}
    cnt[2] = len(d)
    for i in range(len(d)):
        val = d[i]
        if val >= 74:
            cnt[74] += 1
        if val >= 24:
            cnt[24] += 1
        if val >= 14:
            cnt[14] += 1
        if val >= 4:
            cnt[4] += 1

    ans = cnt[74]
    ans += cnt[24] * (cnt[2] - 1)
    ans += cnt[14] * (cnt[4] - 1)
    ans += cnt[4] * (cnt[4] - 1) // 2 * (cnt[2] - 2)

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import heapq

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


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


def main():
    N, M = map(int, input().split())
    d = {i: [] for i in range(M + 1)}
    for _ in range(N):
        a, b = map(int, input().split())
        if a > M:
            continue
        d[a].append(b)

    ans = 0
    q = []
    heapq.heapify(q)
    for i in range(M, 0, -1):
        a = M - i + 1
        for b in d[a]:
            heapq.heappush(q, -b)
        if q:
            b = heapq.heappop(q)
            ans += -b

    print(ans)


if __name__ == "__main__":
    main()
# -*- coding: utf-8 -*-

import matplotlib

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, a[2]):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print("{0}".format(count))


### FIXED CODE ###

# -*- coding: utf-8 -*-

a = input().split()
A = input().split()

for i in range(0, len(a)):
    a[i] = int(a[i])

for i in range(0, len(A)):
    A[i] = int(A[i])

count = 0
for i in range(0, len(A)):
    if(A[i] < a[2]):
        count = count + 1


if(count > (len(A) -  count)):
        count = len(A) -  count

print("{0}".format(count))
n = int(input())
h_list = list(map(int,input().split()))
ans_list =[]
ans = 0
for t in range(a,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if t == n-2:
      ans_list.append(ans)
  else:
    ans_list.append(ans)
    ans = 0
print(max(ans_list))

### FIXED CODE ###

n = int(input())
h_list = list(map(int,input().split()))
max = 0
ans = 0
for t in range(0,n-1):
  if h_list[t] >= h_list[t+1]:
    ans += 1
    if ans >= max:
      max = ans
  else:
    ans = 0
print(max)
import math
a, b, x = map(int, input().split())

# 台形の場合
if a * a * b <= 2 * x:
    y = 2 * x / (a*a) - b
    print(90 - math.degrees(math.atan(a/(b-y))))

else:
    y = 2 * x / a / b
    print(90 - math.degrees(math.atan(y/b)))

### FIXED CODE ###

import math
a, b, x = map(int, input().split())

if a * a * b == x:
    print(0)
# 台形の場合
elif a * a * b < 2 * x:
    y = 2 * x / (a*a) - b
    print(90 - math.degrees(math.atan(a/(b-y))))

else:
    y = 2 * x / a / b
    print(90 - math.degrees(math.atan(y/b)))
a, b = [int(i) for i in input().split(' ')]
result = [a+b, a-b, a*b]
print(result.max())

### FIXED CODE ###

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