티스토리 뷰
# 2875번 대회 or 인턴
import sys
N, M, K = map(int, sys.stdin.readline().split())
# K를 구하는 과정
while K > 0:
if N // 2 > M:
N = N - 2
K = K - 2
elif N // 2 < M:
M = M - 1
K = K - 1
else:
N = N - 2
M = M - 1
K = K - 3
if min(N // 2, M) > 0:
print(min(N // 2, M))
else:
print(0)
'Algorithm > noj.am' 카테고리의 다른 글
[Python] 백준 2667번 - 단지번호붙이기 (0) | 2021.01.26 |
---|---|
[Python] 백준 2606번 - 바이러스 (0) | 2021.01.25 |
[Python] 백준 11047번 - 동전 0 (0) | 2021.01.24 |
[Python] 백준 1780번 - 종이의 갯수 (0) | 2021.01.24 |
[Python] 백준 11728번 - 배열 합치기 (0) | 2021.01.22 |