๋ฌธ์ œ

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

์„ค๋ช…

์ด๋ฌธ์ œ๋„ ๊ทธ๋ƒฅ ๊ฐ€๋กœ๊ฐ€ w, ์„ธ๋กœ๊ฐ€ h์ธ ๋ฐฐ์—ด(ํ‘œ)์—์„œ ์™ผ์ชฝ ์•„๋ž˜๋ถ€ํ„ฐ ์œ„์— ์˜ค๋ฅธ์ชฝ ๋ฐฉํ–ฅ์œผ๋กœ ์ฐจ๋ก€์ฐจ๋ก€ ์†๋‹˜์„ ์ฑ„์šฐ๋„๋ก ํ•˜๋ฉด ๋˜๋Š” ๋ฌธ์ œ๋กœ ํฌ๊ฒŒ ์–ด๋ ค์šด ๋ถ€๋ถ„์€ ์—†์—ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์•„์ง๋„ ๋ฏธ์Šคํ…Œ๋ฆฌ์ธ๊ฑด ์ตœ์ข…์ ์œผ๋กœ w๋ณ€์ˆ˜์˜ ๊ฐ’์€ ๋ฐ›์•˜๊ธดํ•˜๋‚˜ ๊ฒฐ๊ตญ ์“ฐ์ง„ ์•Š์•˜๋Š”๋ฐ ๊ทธ๋Ÿด๊บผ๋ฉด ์™œ ์ค€๊ฑด์ง€ ์˜๋ฌธ์ด ๋“ ๋‹ค.(ใ…ก_ใ…ก;;)

์ฝ”๋“œ

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int t=0;
	scanf("%d", &t);
	for (int i = 0; i < t; i++)
	{
		int h, w, n;
		scanf("%d %d %d", &h, &w, &n);
		int temp1 = (n / h)+1;
		int temp2 = n % h;
		if (temp2 == 0)
		{
			temp1--;
			temp2 = h;
		}
		printf("%d", temp2);
		if (temp1 < 10)
			printf("0");
		printf("%d\n", temp1);
	}
	return 0;
}