본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#50 백준 파이썬 [10250] ACM 호텔

https://www.acmicpc.net/problem/10250



#Solution



import math

case = int(input())
result = []
for i in range(case):
H, W, N = map(int, input().split())
N_width = str(math.ceil(N / H))
if H == 1 or N % H == 0:
N_height = str(H)
else:
N_height = str(N % H)
room = N_height+"{0:0>2}".format(N_width)
result.append(room)

for i in result:
print(int(i))