#include <stdio.h>
int main(void)
{
int height, width, n, tN; // floor, roomNo, the order of the customer
scanf("%d", &tN);
while (tN--)
{
scanf("%d %d %d", &height, &width, &n);
width = n / height;
if (n % height)
{
width++;
height = n % height;
}
printf("%d%02d\n", height, width);
}
return 0;
}
#include <stdio.h>
int main(void)
{
int height, width, n, tN; // floor, roomNo, the order of the customer
scanf("%d", &tN);
while (tN--)
{
scanf("%d %d %d", &height, &width, &n);
printf("%d%02d\n", (n - 1) % height + 1, (n - 1) / height + 1);
}
return 0;
}
'문제풀이' 카테고리의 다른 글
[C언어] 백준 2275 부녀회장이 될테야 (0) | 2021.12.29 |
---|---|
[C언어] 백준 1193 분수찾기 (0) | 2021.12.28 |
[C언어] 백준 2292 벌집 (0) | 2021.12.25 |
[C언어] 백준 1712 손익분기점 (0) | 2021.12.24 |
[C언어] 백준 1316 그룹 단어 체커 (0) | 2021.12.24 |