Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02783 (python)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, A = MAP()

print(ceil(H/A))

Buggy submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H = INT()

print(2**len("{:b}".format(H))-1)

Buggy submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H = INT()

print(2**(ceil(log2(H)))-1)
Problem p02787 (python)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, N = MAP()
temp = [LIST() for _ in range(N)]
temp = [list(x) for x in zip(*temp)]
A, B = temp[0], temp[1]

DP = [[INF]*(H + max(A) + 1) for _ in range(N + 1)]
DP[0][0] = 0
a = max(A)

for i in range(N):
	for j in range(H + a + 1):
		if j < A[i]:
			DP[i+1][j] = DP[i][j]
		else:
			DP[i+1][j] = min(DP[i][j], DP[i+1][j-A[i]] + B[i])

print(min(DP[N][H:H + max(A) + 1]))

Buggy submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2, floor
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, N = MAP()
temp = [LIST() for _ in range(N)]
temp = [list(x) for x in zip(*temp)]
A, B = temp[0], temp[1]

DP = [[INF]*(H + max(A) + 1) for _ in range(N + 1)]
DP[0][0] = 0
a = max(A)

for i in range(N):
	for j in range(H + a + 1):
		if j < A[i]:
			DP[i+1][j] = DP[i][j]
		else:
			DP[i+1][j] = min(DP[i][j], DP[i+1][j-A[i]] + B[i])

print(min(DP[N][H:H + max(A) + 1]))
Problem p02837 (python)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

a = []
for i in range(N):
	A = INT()
	a.append([LIST() for _ in range(A)])

maxv = 0
for i in range(2**N):
	s = "{:0" + str(N) + "b}"
	F = [int(i) for i in s.format(i)]
	flag = 0
	for j in range(N):
		if F[j] == 1:
			for k in range(len(a[j])):
				if a[j][k][1] == 1:
				 	if F[a[j][k][0] - 1]*a[j][k][1] == 0:
				 		flag = 1
					 	break
				else:
					if F[a[j][k][0] - 1] == 0:
						continue
					if F[a[j][k][0] - 1]*a[j][k][1] == 0:
						flag = 1
						break

	if flag == 1:
		continue

	wa = sum(F)
	if maxv < wa:
		maxv = wa

print(maxv)

Buggy submission (verdict: Runtime Error):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

a = []
for i in range(N):
	A = INT()
	a.append([LIST() for _ in range(A)])

maxv = 0
for i in range(2**N):
	s = "{:0" + str(3) + "b}"
	F = [int(i) for i in s.format(i)]
	flag = 0
	for j in range(N):
		if F[j] == 1:
			for k in range(len(a[j])):
				if a[j][k][1] == 1:
				 	if F[a[j][k][0] - 1]*a[j][k][1] == 0:
				 		flag = 1
					 	break
				else:
					if F[a[j][k][0] - 1]*a[j][k][1] == 0:
						flag = 1
						break

	if flag == 1:
		continue

	wa = sum(F)
	if maxv < wa:
		maxv = wa

print(maxv)
Problem p03035 (python)

Fixed submission:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
A, B = MAP()
 
if A >= 13:
  print(B)
  exit()
if A <= 5:
  print(0)
  exit()
print(B//2)

Buggy submission (verdict: Runtime Error):
ort sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
A, B = MAP()
 
if A >= 13:
  print(B)
  exit()
if A <= 5:
  print(0)
  exit()
print(B//2)
Problem p02765 (python)

Fixed submission:
N, R = list(map(int, input().split()))
print(R if N >= 10 else R + 100*(10-N))

Buggy submission (verdict: Runtime Error):
n = int(input())
X = list(map(int, input().split()))
x_min = min(X)
x_max = max(X)

min_val = 10**6 + 1

for i in range(x_min, x_max + 1):
    min_val = min(min_val, sum(map(lambda x: (x-i)**2, X)))

print(min_val)
Problem p02837 (python)

Fixed submission:
#!/usr/bin/env python3]
import sys
sys.setrecursionlimit(2000)

N = int(input())
syogen = []
for i in range(N):
    N_a = int(input())
    syogen_a = []
    for _ in range(N_a):
        x, y = input().split()
        syogen_a.append([int(x) - 1, int(y)])
    syogen.append(syogen_a)


def syojiki(i):
    for x, y in syogen[i]:
        if y == 1:
            syojiki_list.append(x)
            if len(syojiki_list) >= N:
                return
            syojiki(x)


def check_syojiki(syojikitati):
    d = {}
    for s in range(N):
        if s in syojikitati:
            d[s] = 1
        else:
            d[s] = 0

    for s in syojikitati:
        d[s] = 1
        for x, y in syogen[s]:
            if d[x] != y:
                return False
    return True


max_syojiki = 0

for i in range(2 ** N):
    d = {}
    syojiki_list = []
    for j in range(N):
        if (i >> j) & 1:
            syojiki_list.append(j)
            syojiki(j)
    syojiki_list = list(set(syojiki_list))
    if check_syojiki(syojiki_list):
        max_syojiki = max(max_syojiki, len(syojiki_list))

print(max_syojiki)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3]
import sys
sys.setrecursionlimit(2000)

N = int(input())
syogen = []
for i in range(N):
    N_a = int(input())
    syogen_a = []
    for _ in range(N_a):
        x, y = input().split()
        syogen_a.append([int(x) - 1, int(y)])
    syogen.append(syogen_a)


def syojiki(i):
    for x, y in syogen[i]:
        if y == 1:
            syojiki_list.append(x)
            if len(syojiki_list) >= N:
                return
            syojiki(x)


def check_syojiki(syojikitati):
    d = {}
    for s in range(N):
        if not (s in syojikitati):
            d[s] = 0

    for s in syojikitati:
        d[s] = 1
        for x, y in syogen[s]:
            if d[x] != y:
                return False
            else:
                d[x] = y
    return True


max_syojiki = 0

for i in range(2 ** N):
    d = {}
    syojiki_list = []
    for j in range(N):
        if (i >> j) & 1:
            syojiki_list.append(j)
            syojiki(j)
    syojiki_list = list(set(syojiki_list))
    if check_syojiki(syojiki_list):
        max_syojiki = max(max_syojiki, len(syojiki_list))

print(max_syojiki)
Problem p02909 (python)

Fixed submission:
S = input()
if S[0] == 'S':
    print('Cloudy')
elif S[0] == 'C':
    print('Rainy')
else:
    print('Sunny')

Buggy submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Buggy submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')
Problem p02911 (python)

Fixed submission:
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(Q):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Buggy submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + a) > 0 else 'No')

Buggy submission (verdict: Runtime Error):
N, K, Q = [int(s) for s in input().split()]
A = [0] * N
for i in range(N):
    A[int(input()) - 1] += 1

for a in A:
    print('Yes' if (K - Q + A) > 0 else 'No')
Problem p02988 (python)

Fixed submission:
N = int(input())

p_list = [int(s) for s in input().split()]

cnt = 0

for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]:
  	cnt += 1

  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]:
  	cnt += 1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
p_list = [int(s) for s in input.split()]
 
cnt = 0
 
for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]:
  	cnt += 1
 
  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]:
  	cnt += 1
    
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
p_list = [int(s) for s in input.split()]

cnt = 0

for i in range(1,N-1):
  if p_list[i-1] < p_list[i] and p_list[i] < p_list[i+1]
  	cnt += 1

  if p_list[i+1] < p_list[i] and p_list[i] < p_list[i-1]
  	cnt += 1
    
print(cnt)
Problem p03105 (python)

Fixed submission:
A,B,C = [int(s) for s in input().split()]
 
print(C) if B//A >= C else print(B//A)

Buggy submission (verdict: Runtime Error):
A,B,C = [int(s) for s in input().split()]

print(C) if B B//A >= C else print(B//A)
Problem p03106 (python)

Fixed submission:
import sys

A,B,K = [int(s) for s in input().split()]

cnt = 0

N = min(A,B) 

for i in range(N,0,-1):
  if A % i == 0 and B % i == 0:
    cnt += 1
  if cnt == K:
    print(i)
    sys.exit()

Buggy submission (verdict: Runtime Error):
import math
import collections

def gcd(x,y)
	if y==0: return x
  return gcd(y,x%y)

gc_value = gcd(A,B)
N = gc_value

# N : 素因数分解
prime_factor = []
for i in range(2,int(math.sqrt(N))+1):
  while N%i == 0:
    prime_factor.append(i)
    N/=i
    
if N > 1:
  prime_factor.append(N)
  
for i in range(K-1):
  gc_value/=prime_factor[i]

print(int(gc_value))
Problem p03292 (python)

Fixed submission:
def LI():
	return [ int(s) for s in input().split() ]
 
A = LI()
 
A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[2]-A[0])
 
print(min(A12+A23,A23+A31,A31+A12))

Buggy submission (verdict: Runtime Error):
def LI():
	return [ int(s) for s in input().split() ]

A = LI()

A12 = abs(A[0]-A[1])
A23 = abs(A[1]-A[2])
A31 = abs(A[3]-A[1])

print(min(A12+A23,A23+A31,A31+A12))
Problem p03294 (python)

Fixed submission:
N = input()

print(sum([int(s)-1 for s in input().split()]))

Buggy submission (verdict: Runtime Error):
print(sum([a-1 int(s) for s in input().split()])
Problem p03324 (python)

Fixed submission:
def LI():
	return [ int(s) for s in input().split() ]
  
D,N = LI()
 
print((100**D) * N) if N != 100 else print((100**D)*(N+1))

Buggy submission (verdict: Runtime Error):
D,N = [int(s) for s in input().split()]
print (100 ** D) * N
Problem p03408 (python)

Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

M = int(input())
T = [input() for _ in range(M)]

s_counter = Counter(S)
t_counter = Counter(T)

result = 0

for k, v in s_counter.items():
    result = max(result, v - (t_counter[k] if t_counter[k] else 0))

print(result if result > 0 else 0)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]

M = int(input())
T = [input() for _ in range(M)]

s_counter = Counter(S)
t_counter = Counter(T)

result = 0

for k, v in s_counter:
    result = max(result, v - (t_counter[k] if t_counter[k] else 0))

print(result)
Problem p02775 (python)

Fixed submission:
import sys
import functools
# sys.setrecursionlimit(100000000)
n = input()
# import random
# n = ''.join(str(random.randint(1,9)) for _ in range(10**6))

#
# @functools.lru_cache(None)
# def doit(index: int, carry: int) -> int:
#     if index >= len(n):
#         return 0 if carry == 0 else 2
#     d = int(n[index])
#     if carry > 0:
#         return min(10 - d + doit(index + 1, 0), 9 - d + doit(index + 1, 1))
#     else:
#         return min(d + doit(index + 1, 0), d + 1 + doit(index + 1, 1))
#
#
# print(min(doit(0, 0), 1 + doit(0, 1)))


dp = [0, 2]
for d in reversed(n):
    d = int(d)
    dp = [min(d + dp[0], d + 1 + dp[1]), min(10 - d + dp[0], 9 - d + dp[1])]

print(min(dp[0], 1 + dp[1]))

Buggy submission (verdict: Runtime Error):
import sys
import functools
sys.setrecursionlimit(100000000)
n = input()


@functools.lru_cache(None)
def doit(index: int, carry: int) -> int:
    if index >= len(n):
        return 0 if carry == 0 else 2
    d = int(n[index])
    if carry > 0:
        return min(10 - d + doit(index + 1, 0), 9 - d + doit(index + 1, 1))
    else:
        return min(d + doit(index + 1, 0), d + 1 + doit(index + 1, 1))


print(min(doit(0, 0), 1 + doit(0, 1)))

Buggy submission (verdict: Runtime Error):
import sys
import functools
sys.setrecursionlimit(100000000)
n = input()


@functools.lru_cache(None)
def doit(index: int, carry: int) -> int:
    if index >= len(n):
        return 0 if carry == 0 else 2
    d = int(n[index])
    if carry > 0:
        return min(10 - d + doit(index + 1, 0), 9 - d + doit(index + 1, 1))
    else:
        return min(d + doit(index + 1, 0), d + 1 + doit(index + 1, 1))


print(min(doit(0, 0), 1 + doit(0, 1)))

Buggy submission (verdict: Runtime Error):
import sys
import functools
sys.setrecursionlimit(10000000)
n = input()


@functools.lru_cache(None)
def doit(index: int, carry: int) -> int:
    if index >= len(n):
        return 0 if carry == 0 else 2
    d = int(n[index])
    if carry > 0:
        return min(10 - d + doit(index + 1, 0), 9 - d + doit(index + 1, 1))
    else:
        return min(d + doit(index + 1, 0), d + 1 + doit(index + 1, 1))


print(min(doit(0, 0), 1 + doit(0, 1)))
Problem p02900 (python)

Fixed submission:
def gcd(a, b):
    while a != 0:
        a, b = b % a, a
    return b


def pf(v):
    result = 1
    for i in range(2, v + 1):
        if v < i * i:
            if v > 1:
                result += 1
            break
        if v % i == 0:
            result += 1
        while v > 1 and v % i == 0:
            v //= i
    return result


a, b = list(map(int, input().split()))
print(pf(gcd(a, b)))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    import math
    return math.gcd(a, b)


def pf(v):
    s, e = 3, v
    result = 2 if v & 1 == 0 else 1
    while v & 1 == 0:
        v >>= 1
    for i in range(s, e, 2):
        if v == 1:
            break
        if v % i == 0:
            result += 1
        while v > 1 and v % i == 0:
            v //= i
    return result


a, b = list(map(int, input().split()))
print(pf(gcd(a, b)))
Problem p03032 (python)

Fixed submission:
import sys
sys.setrecursionlimit(101)

n, k = list(map(int, input().split()))
vs = list(map(int, input().split()))
memo = {}


def doit(l, r, kk):
    if kk == 0 or l > r:
        return 0
    if (l, r, kk) not in memo:
        memo[(l, r, kk)] = max(vs[l] + doit(l + 1, r    , kk - 1),
                           vs[r] + doit(l    , r - 1, kk - 1),
                                   doit(l + 1, r    , kk - 2) if kk > 1 else 0,
                                   doit(l    , r - 1, kk - 2) if kk > 1 else 0)
    return memo[(l, r, kk)]


print(doit(0, n - 1, k))

Buggy submission (verdict: Runtime Error):
n, k = list(map(int, input().split()))
vs = list(map(int, input().split()))


def doit(vv, kk):
    if kk == 0:
        return 0
    return max(vv[0] + doit(vv[1:], kk - 1),
               vv[-1] + doit(vv[:-1], kk - 1),
               doit(vv[1:], kk - 2) if kk > 1 else 0,
               doit(vv[:-1], kk - 2) if kk > 1 else 0)


print(doit(vs, k))
Problem p03061 (python)

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


N = int(input())
A = list(map(int, input().split()))
r = 0
b = -1

for i in range(N):
    a = gcd(r, A[i]) if r != 0 else A[i]
    if a < r:
        b = i
    r = a

r3 = 0
for i in range(N):
    if i == b - 1:
        continue
    r3 = gcd(r3, A[i]) if r3 != 0 else A[i]

r4 = 0
for i in range(N):
    if i == b:
        continue
    r4 = gcd(r4, A[i]) if r4 != 0 else A[i]

d = sorted([(gcd(A[i], A[i + 1]), i) for i in range(N - 1)])
t = d[0][1]
r1 = 0
for i in range(N):
    a = A[i-1] if i == t + 1 else A[i]
    if r1 == 0:
        r1 = a
    else:
        r1 = gcd(r1, a)
r2 = 0
for i in range(N):
    a = A[i+1] if i == t else A[i]
    if r2 == 0:
        r2 = a
    else:
        r2 = gcd(r2, a)
print(max(r1, r2, r3, r4))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while a:
        a, b = b % a, a
    return b


N = int(input())
A = list(map(int, input().split()))
b = -1

for i in range(N):
    a = gcd(r, A[i]) if r != 0 else A[i]
    if a < r:
        b = i
    r = a

r3 = 0
for i in range(N):
    if i == b - 1:
        continue
    r3 = gcd(r3, A[i]) if r3 != 0 else A[i]

r4 = 0
for i in range(N):
    if i == b:
        continue
    r4 = gcd(r4, A[i]) if r4 != 0 else A[i]

d = sorted([(gcd(A[i], A[i + 1]), i) for i in range(N - 1)])
t = d[0][1]
r1 = 0
for i in range(N):
    a = A[i-1] if i == t + 1 else A[i]
    if r1 == 0:
        r1 = a
    else:
        r1 = gcd(r1, a)
r2 = 0
for i in range(N):
    a = A[i+1] if i == t else A[i]
    if r2 == 0:
        r2 = a
    else:
        r2 = gcd(r2, a)
print(max(r1, r2, r3, r4))