알고리즘/BOJ

[C++] 백준 10250번 ACM호텔

Jay, Lee 2021. 3. 11. 16:28
#include <iostream>
using namespace std;

int main() {

	int testCase, height, width, number;
	cin >> testCase;

	for (int i = 0; i < testCase; i++) {
		cin >> height >> width >> number;

		int y, x;
		y = number % height;
		x = number / height;
		
		if (y > 0) {
			x++;
		}
		else {
			y = height;
		}
		cout << y * 100 + x << "\n";
	}
	return 0;
}