Harryxun/stf_run huggingface dataset:
def calc_sadness(points, b):
    return sum([abs(y - (b + x)) for x, y in points])

N = int(input())
A = [int(i) for i in input().split()]

points = [(i+1, y) for i, y in enumerate(A)]

b_list = [y - x for x, y in points]
b_list.sort(reverse=True)

sad_list = [(b, calc_sadness(points, b)) for b in b_list]
sad_list.sort(key=lambda x:x[1])

peak_sads = sorted(sad_list[:2], key=lambda x:x[0])

min_sad = 10000000000
for b in range(peak_sads[0][0], peak_sads[1][0]+1):
    sadness = calc_sadness(points, b)
    if sadness < min_sad:
        min_sad = sadness

print(min_sad)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
def calc_sadness(points, b):
    return sum([abs(y - (b + x)) for x, y in points])

points = [(i+1, y) for i, y in enumerate(A)]

# y = x + b
# b = y - x
b_list = [y - x for x, y in points]
b_list.sort(reverse=True)

max_b = b_list[0]
min_b = b_list[-1]

best_ind = len(b_list)//2

minimum = calc_sadness(points, b_list[best_ind])

print(minimum)
n=list(map(int,input()))
for i in (range(3)):
    if n[i]==n[i+1]:
        count+=1
if count>=1:
    print("Bad")
else:
    print("Good")

### FIXED CODE ###

n=list(map(int,input()))
count=0
for i in (range(3)):
    if n[i]==n[i+1]:
        count+=1
if count>=1:
    print("Bad")
else:
    print("Good")
a, b = map(int, input().split())
k = 1
s = 0
for i in map(int, input().split()):
    if s + i <= b:
        k += 1
    s += i
print(k)


### FIXED CODE ###

x,y=map(int,input().split())
if x<y:
    print(0)
else:
    print(10)
a,b,c=input().split()
a=int(a)
c=int(c)
if b=='+':
  print(a+b)
else:
  print(a-b)

### FIXED CODE ###

a,b,c=input().split()
a=int(a)
c=int(c)
if b=='+':
  print(a+c)
else:
  print(a-c)
#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
def lcm_base(x, y):
    interium=x//math.gcd(x, y)
    return (interium*y)
print(reduce(lcm_base, T))


### FIXED CODE ###

#ABC070C
import math
from functools import reduce
N=int(input())
T=[int(input()) for i in range(N)]
#def lcm_base(x, y):
#    interium=x//math.gcd(x, y)
#    return (interium*y)
#print(reduce(lcm_base, T))
ans=1
def grcode(x, y):
    if y==0:
        return (x)
    else:
        return grcode(y, x%y)
for i in range(N-1):
    T[i]=T[i]//grcode(T[i],T[i+1])
    T[i+1]=T[i]*T[i+1]
print(T[N-1])
op = ["+", "-", "*"]
x = int(raw_input())
while True:
    a, b, c, d = map(str, raw_input().split())
    if a == 0 and c == 0:
        break
    n = [0,1,2,3]
    q = [str(a),str(b),str(c),str(d)]
    flag = 0
    m = [0,1,2,3]
    m.remove(ii)
    for ii in n:
        for jj in m:
            l = [0,1,2,3]
            l.remove(ii);l.remove(jj)
            for kk in l:
                o = [0,1,2,3]
                o.remove(ii);o.remove(jj);o.remove(kk)
                for ll in o:
                    for i in op:
                        for j in op:
                            for k in op:
                                if eval( "((("+q[ii]+k+q[jj]+")"+j+q[kk]+")"+i+q[ll]+")") == x:
                                    print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
                                    flag = 1
                                    break
                                if eval( "(("+q[ii]+k+q[jj]+")"+i+"("+q[kk]+j+q[ll]+"))" ) == x:
                                    print "((",q[ii],k,q[jj],")",i,"(",q[kk],j,q[ll],"))"
                                    flag = 1
                                    break
                            if flag == 1:
                                break
                        if flag == 1:
                            break
                    if flag == 1:
                        break
                if flag == 1:
                    break
            if flag == 1:
                break
        if flag == 1:
            break
    if flag == 0:
        print 0

### FIXED CODE ###

op = ["+", "-", "*"]
while True:
    a, b, c, d = map(str, raw_input().split())
    if a == "0" and c == "0":
        break
    n = [0,1,2,3]
    q = [a,b,c,d]
    flag = 0
    for ii in n:
        m = [0,1,2,3]
        m.remove(ii)
        for jj in m:
            l = [0,1,2,3]
            l.remove(ii);l.remove(jj)
            for kk in l:
                o = [0,1,2,3]
                o.remove(ii);o.remove(jj);o.remove(kk)
                for ll in o:
                    for i in op:
                        for j in op:
                            for k in op:
                                if eval( "((("+q[ii]+k+q[jj]+")"+j+q[kk]+")"+i+q[ll]+")") == 10:
                                    print "(((",q[ii],k,q[jj],")",j,q[kk],")",i,q[ll],")"
                                    flag = 1
                                    break
                                if eval( "(("+q[ii]+k+q[jj]+")"+i+"("+q[kk]+j+q[ll]+"))" ) == 10:
                                    print "((",q[ii],k,q[jj],")",i,"(",q[kk],j,q[ll],"))"
                                    flag = 1
                                    break
                            if flag == 1:
                                break
                        if flag == 1:
                            break
                    if flag == 1:
                        break
                if flag == 1:
                    break
            if flag == 1:
                break
        if flag == 1:
            break
    if flag == 0:
        print 0
from itertools import combinations
import math
n,d=map(int,input().split())
X=[list(map(int,input().split())) for _ in range(n)]
cnt=0
for perm in list(combinations(range(n),2)):
    d=sum(map(lambda x: (x[0]-x[1])**2,zip(X[perm[0]],X[perm[1]])))
    if d==int(math.sqrt(d))**2:
        cnt+=1
print(cnt)

### FIXED CODE ###

n,m=map(int,input().split())
d={}
for i in range(n):
    d[i]=0
for i in range(m):
    a,b=map(int,input().split())
    d[a-1]+=1
    d[b-1]+=1
for i in range(n):
    print(d[i])
H,W=map(int,input().split())
A=[tuple(input()) for _ in range(H)]
next_q=[]
L=[[0]*W for _ in range(H)]
for i,row in enumerate(A):
    for j,c in enumerate(row):
        if c=='#':
            next_q.append((i,j))
            L[i][j]=1
res=-1
while len(next_q)!=0:
    q,next_q=next_q[:],[]
    if len(q)==0:break
    while len(q)!=0:
        x,y=q.pop(0)
        if x>0 and L[x-1][y]==0:
            L[x-1][y]=1
            next_q.append((x-1,y))
        if x<W-1 and L[x+1][y]==0:
            L[x+1][y]=1
            next_q.append((x+1,y))
        if y>0 and L[x][y-1]==0:
            L[x][y-1]=1
            next_q.append((x,y-1))
        if y<H-1 and L[x][y+1]==0:
            L[x][y+1]=1
            next_q.append((x,y+1))
    res+=1
print(res)

### FIXED CODE ###

from collections import deque
import copy
H, W = map(int, input().split())
A = tuple(tuple(input()) for _ in range(H))
L=[[0]*W for _ in range(H)]
next_q=deque()

for i in range(H):
    for j in range(W):
        if A[i][j]=='#':
            L[i][j]=1
            next_q.append((i,j))

q=deque()

res = 0
while len(next_q) != 0:
    q=copy.copy(next_q)
    next_q.clear()
    while q:
        y, x = q.popleft()
        if y > 0 and L[y - 1][x] == 0:
            L[y - 1][x] = 1
            next_q.append((y - 1, x))
        if y < H - 1 and L[y + 1][x] == 0:
            L[y + 1][x] = 1
            next_q.append((y + 1, x))
        if x > 0 and L[y][x - 1] == 0:
            L[y][x - 1] = 1
            next_q.append((y, x - 1))
        if x < W - 1 and L[y][x + 1] == 0:
            L[y][x + 1] = 1
            next_q.append((y, x + 1))
    if len(next_q)==0: break
    res += 1
print(res)
import sys
input=sys.stdin.readline

ans=0
N,M=map(int,input().split())
Ar=[[] for _ in range(M)]
for _ in range(N):
      A,B=map(int,input().split())
      if A <= M:
          Ar[A-1].append(B)
An=[]
for i in range(M):
      An += Ar[i]
      if len(An)>0:
          An = An.sort()
          ans+=An.pop(len(An)) 
print(ans)


### FIXED CODE ###

import heapq
N , M = map(int , input().split())
jobs = [list(map(int , input().split())) for _ in range(N)]
jobs.sort()

q = []
index = 0
ans = 0
for limit in range(1 , M + 1):
    while index < N:
        time =jobs[index][0]
        reward = jobs[index][1]
        if limit >= time:
            heapq.heappush(q , -reward)
            index += 1
        else:
            break
    #print(q)
    if len(q) != 0:
        tmp = heapq.heappop(q)
        ans -= tmp

print(ans)
class UFTree():
  def __init__(self,n):
    self.parent = {i:i for i in range(1,n+1)}
    
  def root(self,n):
    if self.parent[n]==n: return n
    else: return self.root(self.parent[n])
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx!=ry: self.parent[rx] = ry
  
  def same(self,x,y):
    return self.root(x)==self.root(y)
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A,B)
  
ans = {i+1:0 for i in range(N)}
for i in range(N):
  ans[uft.root(i+1)]+=1
print(max(ans.values()))

### FIXED CODE ###

class UFTree():
  def __init__(self,n):
    self.N = n
    self.parents = [-1]*n
    
  def root(self,n):
    if self.parents[n]<0: return n
    else:
      self.parents[n] = self.root(self.parents[n])
      return self.parents[n]
      
  def unite(self,x,y):
    rx,ry = self.root(x), self.root(y)
    if rx==ry: return
    if rx>ry: rx,ry = ry,rx
    self.parents[rx] += self.parents[ry]
    self.parents[ry] = rx
      
  def size(self,x):
    return -self.parents[self.root(x)]
  
N,M = map(int,input().split())
uft = UFTree(N)
for i in range(M):
  A,B = map(int,input().split())
  uft.unite(A-1,B-1)
print(max([uft.size(i) for i in range(N)]))
a = input()
s = input()
print(s.count("ABC")

### FIXED CODE ###

a = input()
s = input()
print(s.count("ABC"))
n = int(input())
a = list(map(int, input().split()))
cnt = 0
i = 0
while i < n - 1:
    if a[i] == a[i + 1] == a[i + 2]:
        cnt += 1
        i += 1
    elif a[i] == a[i + 1]:
        cnt += 1
    i += 1
print(cnt)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
cnt = 0
i = 0
while i < n - 1:
    if i < n - 2 and a[i] == a[i + 1] == a[i + 2]:
        cnt += 1
        i += 1
    elif a[i] == a[i + 1]:
        cnt += 1
    i += 1
print(cnt)
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
t_max = max(t)
for i in range(n):
  if a[i] == t_max:
    max_ind = i
    break
if t[max_ind] != a[max_ind] or t[-1] != a[0]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx .append(i)
    before = t[i]
  if len(idx) == 0:
    print(1)
  else:
    new_idx = []
    for j in idx:
      if j < n-1 and a[j] == a[j+1]:
        new_idx.append(j)
    if len(new_idx) == 0:
      print(0)
    else:
      ans = 1
      for k in new_idx:
        ans *= min(t[k], a[k])
        ans %= MOD
      print(ans)

### FIXED CODE ###

n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
MOD = 10**9 + 7
t_max = max(t)
for i in range(n):
  if t[i] == t_max:
    max_ind = i
    break
if t[max_ind] != a[max_ind] or t[-1] != a[0]:
  print(0)
else:
  idx = []
  before = 0
  for i in range(n):
    if before == t[i]:
      idx .append(i)
    before = t[i]
  if len(idx) == 0:
    print(1)
  else:
    new_idx = []
    for j in idx:
      if j < n-1 and a[j] == a[j+1]:
        new_idx.append(j)
    if len(new_idx) == 0:
      print(1)
    else:
      ans = 1
      for k in new_idx:
        ans *= min(t[k], a[k])
        ans %= MOD
      print(ans)
N,M = map(int,input().split())

AC = 0
WA = 0


was = [0]*(N+1)
acs = [0]*(N+1)

for i in range(M):
	p,s = input().split()
	p = int(p)

	if s = "AC":
		if acs[p] == 0:
			AC += 1
			WA += was[p]
			acs[p] = 1
	else:
		was[p] += 1

print(AC,WA)

### FIXED CODE ###


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

AC = 0
WA = 0


was = [0]*(N+1)
acs = [0]*(N+1)

for i in range(M):
	p,s = input().split()
	p = int(p)

	if s == "AC":

		if acs[p] == 0:

			AC += 1
			WA += was[p]
			acs[p] = 1
			
	else:
		was[p] += 1

print(AC,WA)
N=int(input())
A = list(map(int,input().split()))
A = list(set(A))
c = 0
for i in range((N+1)%2, N, 2):
  if not A[c] == i:
    print(0)
    end()
  c += 1
print(2**(c-c%2))

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
if N % 2 == 0:
  for i in range(1,N,2):
    for n in range(2):
      if not A[i + n - 1] == i:
        print(0)
        exit()
  print(2**(N//2)%1000000007)
else:
  for i in range(0,N-1,2):
      for n in range(2):
        if i == 0 and n == 0:
          continue
        if not A[i + n - 1] == i:
          print(0)
          exit()
  print(2**((N-1)//2)%1000000007)
import sys
iN,iK,iL = [int(_) for _ in input().split()]
aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]
a道 = aD[0:iK]
a鉄道 = aD[iK:]

d道 = {}
d鉄道 = {}
for i in range(1,iN+1):
    d道[i] = {i}
    d鉄道[i] ={i}

for p,q in a道:
    d道[p].add(q)
    d道[q].add(p)
for r,s in a鉄道:
    d鉄道[r].add(s)
    d鉄道[s].add(r)

def fdfs(d,iS):
    dsVisited=set()
    def digRoute(iT):
        for i in d[iT] - dsVisited:
            dsVisited.add(i)
            digRoute(i)
    digRoute(iS)
    return dsVisited

aRet = []
for i in range(1,iN+1):
    aRet.append(str(len(fdfs(d道,i) & fdfs(d鉄道,i))))
print( " ".join(aRet))


### FIXED CODE ###

#Union-Find木の構築
import sys
def 解():
    iN,iK,iL = [int(_) for _ in input().split()]
    aD = [[int(_) for _ in sLine.split()] for sLine in sys.stdin.readlines()]

    def buildTree(a):
        aT = [0]*(iN+1)
        for p,q in a:
            rp = getRoot(aT,p)
            rq = getRoot(aT,q)
            thisRoot = max(rp,rq,q)
            aT[p] = thisRoot
            aT[q] = thisRoot
            aT[rp] = thisRoot #これで Union してるつもり
            aT[rq] = thisRoot
        return aT
    def getRoot(a,i): #find みんな小さい方に合わせるならデカい方に合わせてみよう
        if a[i] == i or a[i] == 0:
            if a[i] == 0 : a[i] = i
            return i
        elif i < a[i] :
            a[i] = getRoot(a,a[i])
            return a[i]
    #   else:
    #       print("! ",i,a[i])

    aT道 = buildTree(aD[0:iK])
    aT鉄道 = buildTree(aD[iK:])
    aRet = []
    dRet = {}
    for i in range(1,iN+1):
        # いやはやこんなもんもキーになるのか。
        Comb = (getRoot(aT道,i), getRoot(aT鉄道,i))
        aRet.append(Comb)
        if Comb in dRet:
            dRet[Comb] += 1
        else:
            dRet[Comb] = 1
    print(" ".join([str(dRet[_]) for _ in aRet]))

解()
S = input()
s = set(S)
if ("N" in s and "S" not in s) 
 or ("S" in s and "N" not in s)
 or ("W" in s and "E" not in s)
 or ("E" in s and "W" not in s):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

S = input()
s = set(S)
if ("N" in s and "S" not in s) \
 or ("S" in s and "N" not in s) \
 or ("W" in s and "E" not in s) \
 or ("E" in s and "W" not in s):
    print("No")
else:
    print("Yes")
a=input()

print(a+a*a+a*a*a)

### FIXED CODE ###

a=int(input())

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

if a > 8 && b > 8 :
  print (":(")
elif
  print ("Yay!")

### FIXED CODE ###

ALL = input().split()
A = int(ALL[0])
B = int(ALL[1])
 
if A < 9 and B < 9:
    print('Yay!')
else:
    print(':(')
A = input()
op = ["+", "-"]
for bit in range(1 << 4):
    ans = A[0]
    for i in range(3):
        ans += op[bit & (1 << i)]+A[i+1]
    if eval(ans) == 7:
        print(ans+"=7")
        break


### FIXED CODE ###

A = input()
for bit in range(1 << 4):
    ans = int(A[0])
    res = [A[0]]
    for i in range(3):
        if bit & (1 << i):
            ans += int(A[i + 1])
            res.append("+")
            res.append(A[i+1])
        else:
            ans -= int(A[i + 1])
            res.append("-")
            res.append(A[i+1])
    if ans == 7:
        for i in range(7):
            print(res[i], end='')
        print("=7")
        break
N = int(input())
S = list(input())
x=0
maxa=0
for s in S:
  if s=="I":
    x+=1
  else:
    x-=
  maxa=max(x, maxa)
print(maxa)

### FIXED CODE ###

N = int(input())
S = list(input())
x=0
maxa=0
for s in S:
  if s=="I":
    x+=1
  else:
    x-=1
  maxa=max(x, maxa)
print(maxa)
s = input()
count = 0

for i in range(len(s)):
    if s[i] = 'x':
        count += 1
if count >= 8:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

s = input()
count = 0

for i in range(len(s)):
    if s[i] == 'x':
        count += 1
if count >= 8:
    print("NO")
else:
    print("YES")
from sys import stdin
n,k = map(int,stdin.readline().split())
arr = sorted(list(map(int,stdin.readline().split())),key=lambda x:abs(x))
mod = 10**9+7
pos,neg = [],[]
for i in arr:
    if i>=0:
        pos.append(i)
    else:
        neg.append(i)
if not len(pos):
    ans = 1
    if k%2:
        for i in range(k):
            ans *= neg[i]
            ans %= mod
    else:
        for i in range(k):
            ans *= neg[-1-i]
            ans %= mod
else:
    ans = 1
    i=len(pos)-1
    j=len(neg)-1
    val = 0
    if k%2:
        ans *= pos[i]
        i -= 1
        val += 1
    while val != k:
        if i<1:
            ans *= neg[j]*neg[j-1]
            ans %= mod
            j -= 2
        elif j<1:
            ans *= pos[i]*pos[i-1]
            ans %= mod
            i -= 2
        else:
            if pos[i]*pos[i-1]>neg[i]*neg[i-1]:
                ans *= pos[i]*pos[i-1]
                ans %= mod
                i -= 2
            else:
                ans *= neg[j] *neg[j-1]
                ans %= mod
                j -= 2
        k -= 2
print(ans)


### FIXED CODE ###

from sys import stdin
n,k = map(int,stdin.readline().split())
arr = sorted(list(map(int,stdin.readline().split())),key=lambda x:abs(x))
mod = 10**9+7
pos,neg = [],[]
for i in arr:
    if i>=0:
        pos.append(i)
    else:
        neg.append(i)
if not len(pos):
    ans = 1
    if k%2:
        for i in range(k):
            ans *= neg[i]
            ans %= mod
    else:
        for i in range(k):
            ans *= neg[-1-i]
            ans %= mod
else:
    ans = 1
    i=len(pos)-1
    j=len(neg)-1
    val = 0
    if n==k:
        for x in arr:
            ans *= x
            ans %= mod
    else:
        if k%2:
            ans *= pos[i]
            i -= 1
            val += 1
        while val != k:
            if i<1:
                ans *= neg[j]*neg[j-1]
                ans %= mod
                j -= 2
            elif j<1:
                ans *= pos[i]*pos[i-1]
                ans %= mod
                i -= 2
            else:
                if pos[i]*pos[i-1]>neg[j]*neg[j-1]:
                    ans *= pos[i]*pos[i-1]
                    ans %= mod
                    i -= 2
                else:
                    ans *= neg[j]*neg[j-1]
                    ans %= mod
                    j -= 2
            val += 2
print(ans)
def solve( p, t ):
	global isExist, n, A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )
	else:
		return

isExist = [False]*2001 
n = int( input() )
A = map( int, input().rstrip().split( " " ) )
q = int( input() )
M = map( int, input().rstrip().split( " " ) )
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )

### FIXED CODE ###

def solve( p, t ):
	global isExist, n, A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )
	else:
		return

isExist = [False]*2001 
n = int( input() )
A = [ int( val ) for val in input().rstrip().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().rstrip().split( ' ' ) ]
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )
import math


def lcm(x, y):
    return int((x * y) / math.gcd(x, y))


if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    cnt_ac, cnt_bc = int((a-1)/c), int(b/c)
    cnt_ad, cnt_bd = int((a-1)/d), int(b/d)
    cnt_acd, cnt_bcd = int(a/lcm(c,d)), int(b/lcm(c,d))
    print((cnt_bc-cnt_ac), (cnt_bd-cnt_ad), (cnt_bcd-cnt_acd))
    print((b-a+1) - ((cnt_bc-cnt_ac)+(cnt_bd-cnt_ad)-(cnt_bcd-cnt_acd)))


### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(x, y):
    return (x * y) // gcd(x, y)


if __name__ == "__main__":
    a, b, c, d = map(int, input().split())
    a -= 1
    cnt = b - a
    cnt -= b//c - a//c
    cnt -= b//d - a//d
    l = lcm(c, d)
    cnt += b//l - a//l
    print(cnt)
N = int(input())
import math
def num_divisors_trial_division(n):
    num = 0
    for i in xrange(1, int(math.sqrt(n) + 1e-9) + 1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    
    return num
ans = 0
for i in range(1,N):
    n = N - i
    ans += num_divisors_trial_division(n)
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(1,N):
    x = (N-1)//i
    ans += x
print(ans)
a = list(map(int, input().split()))
k = []
for i in range(0, a[0]):
  b = list(map(int, input().split()))
  del b[0]
  k.append(b)

q = 0
for i in range(1, a[1] + 1)
  if k.count(i) == a[0]:
    q += 1
print(q)

### FIXED CODE ###

a = list(map(int, input().split()))
k = []
for i in range(0, a[0]):
  b = list(map(int, input().split()))
  del b[0]
  k += b

kk = 0
for i in range(1, a[1] + 1):
  if k.count(i) == a[0]:
    kk += 1
print(kk)
a, b, c, d = map(int, input().split())
if b * d >= 0:
  print(b * d)
else:
  z = []

  for x in range(a, b + 1):
    for y in range(c, d + 1):
      z.append(x * y)
print(max(z))

### FIXED CODE ###

a = int(input())
if a == 0:
  print(1)
else:
  print(0)
a,b=map(int,input().split())
k=int(input())
for i in range (k):
  if a > 0:
    a-1
  else:
  	if b > 0:
      b-1
print(a, b)
      

### FIXED CODE ###

a,b,k=map(int,input().split())
if a-k>=0:
    print(a-k,b)
elif a+b>=k:
    print(0,a+b-k)
else:
    print(0,0)