10250 - ACM 호텔

solution

code

#include <iostream>
using namespace std;

int main()
{
    int testC;
    int H, W, N;
    cin >> testC;
    int floor;
    int room;
    for(int i = 0; i < testC; i++)
    {
        cin >> H;
        cin >> W;
        cin >> N;
        floor = N%H;
        room = (N / H) + 1;
        if(floor == 0)
        {
            floor = H;
            room--;
        }
        cout << floor * 100 + room << endl;
    }
    return 0;
}

ref

10250번: ACM호텔