https://www.acmicpc.net/problem/10250
아 이문제 정말 문제부터 머리아프다🤯
차근차근 이해해보자..
H = 호텔의 층 수
W = 각 층의 방 수
N = 몇 번째 손님
우선 규칙부터 찾아보면,
t = int(input())
#t개의 테스트 데이터로 이루어져있음
for i in range(t):
#t개만큼 반복
h, w, n = map(int,input().split())
#h,w,n input값 받음
if n%h == 0:
#만약 n이 건물 층 수의 배수라면
rm = n//h
#손님의 방 호 수
floor = h
#손님의 방 층 수
print(f'{floor*100+rm}')
else:
rm = n//h+1
#손님의 방 호 수
floor = n%h
#손님의 방 층 수
print(f'{floor*100+rm}')
#여기서 굳이 F-string을 써주지않아도 된다
조금 더 간단하게 적어본다면 아래와 같다.
t = int(input())
#t개의 테스트 데이터로 이루어져있음
for i in range(t):
#t개만큼 반복
h, w, n = map(int,input().split())
#h,w,n input 받음
RM = n//h+1
floor = n%h
if n%h == 0:
RM = n//h
floor = h
print(f'{floor*100+RM}')