호수를 정할 때 2호라면 602호로 처리해줘야 하는 것을 케이스 처리하는 것이 어려웠다. 구해질 수 있는 두 가지 경우의 수에 모두 호수가 한 자릿수일 때 앞에 0을 붙여주는 것을 다시 생각해서 스스로 풀어냈다 :))
import sys
def sol(H, W, N):
n = N // H
s = N % H
b = ""
if s != 0:
if n + 1 < 10:
b = "0" + str(n+1)
else:
b = str(n+1)
else:
b = str(n)
s = H
return (str(s) + b)
T = int(sys.stdin.readline())
for i in range(T):
H, W, N = map(int, sys.stdin.readline().split())
print(sol(H, W, N))
import sys
def sol(H, W, N):
x = ""
y = ""
if N % H != 0:
x = str(N % H)
if N // H + 1 < 10:
y = "0"+ str(N // H + 1)
else:
y = str(N // H + 1)
else:
x = str(H)
if N // H < 10:
y = "0"+ str(N // H)
else:
y = str(N // H)
return x + y
T = int(sys.stdin.readline())
for i in range(T):
H, W, N = map(int, sys.stdin.readline().split())
print(sol(H, W, N))