티스토리 뷰

PS/백준

10250번 ACM 호텔

unside 2019. 6. 24. 13:08

백준 10250번

문제 사이트 :
https://www.acmicpc.net/problem/10250

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>

using namespace std;
#define Max 100

int Array[Max * Max];

int main(void) {

	int Testcase;
	scanf("%d", &Testcase);
	for (int T = 0; T < Testcase; T++) {
		int H,W,N;
		int index = 1;
		scanf("%d %d %d", &H, &W, &N);
		for (int w = 1; w <= W; w++) {
			for (int h = 1; h <= H; h++) {
				int num = w + h*100;
				Array[index] = num;
				index++;
			}
		}
		printf("%d\n", Array[N]);
	}
	return 0;
}

'PS > 백준' 카테고리의 다른 글

2750번 수 정렬하기  (0) 2019.06.27
1475번 방 번호  (0) 2019.06.24
2775번 부녀회장이 될테야  (0) 2019.06.24
1193번 분수찾기  (0) 2019.06.24
2292번 벌집  (0) 2019.06.24
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함