Programming/백준

[1일 1백준 : 10250번] ACM 호텔

HyeunJae 2021. 2. 3. 20:29
#include <iostream>

const int FindOutRoom(const int H, const int W, const int N)
{
	int HeightFloor;
	int WidthFloor;

	if (N % H == 0)
	{
		HeightFloor = H;
		WidthFloor = (N / H);
	}
	else 
	{
		HeightFloor = (N % H);
		WidthFloor = (N / H) + 1;
	}

	return (HeightFloor * 100) + WidthFloor;
}


int main(void)
{
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	std::ios::sync_with_stdio(false);

	int T = 0, H = 0, W = 0, N = 0;

	std::cin >> T;

	for (int i = 0; i < T; i++)
	{
		std::cin >> H >> W >> N;
		std::cout << FindOutRoom(H, W, N) << "\n";
	}

	return 0;
}

10250번: ACM 호텔 (acmicpc.net)

 

10250번: ACM 호텔

프로그램은 표준 입력에서 입력 데이터를 받는다. 프로그램의 입력은 T 개의 테스트 데이터로 이루어져 있는데 T 는 입력의 맨 첫 줄에 주어진다. 각 테스트 데이터는 한 행으로서 H, W, N, 세 정수

www.acmicpc.net