n, m = map(int, input().split())
arr = []
for _ in range(n):
temp = list(map(int, input().split()))
arr.append(temp)
num = 0
for number in arr:
num = max(num, min(number))
print(num)
n, k = map(int, input().split())
cnt = 0
while True:
if (n % k == 0):
n = n // k
else:
n = n - 1
cnt += 1
if n == 1:
break
print(cnt)
320
n = int(input())
arr = list(map(int, input().split()))
team = 0
count = 0
for i in arr:
count += 1
if ( count >= i ):
team += 1
count = 0
print(result)
313
n = input()
arr = list(map(int, n))
num = arr[0]
for i in range(len(arr)-1):
if (num == 0 or arr[i+1] == 0):
num = num + arr[i+1]
else:
num = num * arr[i+1]
print(num)
s = input()
s = list(map(int, s))
for i in range(len(s)-1):
#맨처음
if (i == 0):
if (s[0] == 1 or s[0] == 0 or s[1] == 1 or s[1] == 0):
answer = s[0] + s[1]
else:
answer = s[0] * s[1]
#맨마지막전
elif (i == len(s)-1):
if (s[-1] == 1 or s[-1] == 0 or s[-1] == 1 or s[-1] == 0):
answer = answer + s[-1]
else:
answer = answer * s[-1]
#나머지
else:
if (s[i+1] == 0 or s[i+1] == 1):
answer = answer + s[i+1]
else:
answer = answer * s[i+1]
print(answer)
s = input()
s = list(map(int, s))
answer = s[0]
for i in range(1, len(s)):
if (s[i] <= 1 or answer <= 0):
answer = answer + s[i]
else:
answer = answer * s[i]
print(answer)
313 문제
https://naekang.tistory.com/42
s = input()
cnt = 0
for i in range(len(s)-1):
if s[i] != s[i+1]:
cnt += 1
change = (cnt+1) // 2
print(change)
315
from itertools import combinations
n = int(input())
arr = list(map(int, input().split()))
if (len(arr) == 1):
if arr[0] == 1:
print(2)
else:
print(1)
else:
answer = arr[:]
for i in range(2, n+1):
for j in combinations(arr, i):
temp = sum(j)
answer.append(temp)
answer = list(set(answer))
answer.sort()
for i in range(1, len(answer)):
if ( i != answer[i-1] ):
print(i)
break
else:
print(answer[-1]+1)
n = int(input())
data = list(map(int, input().split()))
data.sort()
target = 1
for x in data:
if target < x:
break
target += x
print(x, target)
print(target)
from itertools import combinations
n, m = map(int, input().split())
arr = list(map(int, input().split()))
cnt = 0
for a, b in combinations(arr, 2):
if (a != b):
cnt += 1
print(cnt)
n, m = map(int, input().split())
arr = list(map(int, input().split()))
answer = []
for i in range(len(arr)-1):
for j in range(i+1, len(arr)):
if (arr[i] != arr[j]):
answer.append([i, j])
print(len(answer))