본문으로 바로가기
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int t = sc.nextInt();
		int x, y; // x : 엘리베이터로부터의 거리, y : 층

		while(t > 0) {
        
			int h = sc.nextInt();
			int w = sc.nextInt();
			int n = sc.nextInt();
			
			if(n % h == 0) { // h층에 배정될 경우
				
				y = h;
				x = n / h;
			}
			else {
				
				y = n % h;
				x = n / h + 1;
			}
			
			System.out.println(y * 100 + x); // yyxx호 or yxx호
			
			t--;
		}
		
		sc.close();
	}
}