๐ ์๋์/์ธต์๊ฐ 0์ผ๋ก ๋๋์ด๋จ์ด์ง ๋๋ฅผ ๊ณ ๋ คํ์ง ์์ ๊ณ์ ํ๋ ธ์๋ค๐ข
const fs = require('fs');
const input = fs.readFileSync('/dev/stdin').toString().split('\n');
let num = parseInt(input[0]);
let height,width;
//ํ
์คํธ ๋ฐ์ดํฐ ๊ฐ์๋งํผ ๋ฐ๋ณต
for(let i=1; i<=num; i++){
let data=input[i].split(' ')
let H = parseInt(data[0]);
let W = parseInt(data[1]);
let N = parseInt(data[2]);
if(N%H===0){//์๋์/์ธต์์ ๋๋จธ์ง๊ฐ 0์ผ ๊ฒฝ์ฐ๋ ์ ์ผ ๋์ ์ธต,๋ชซ์ 1๋ํ์ง ์์
height=H.toString();
width=Math.floor(N/H);
}else{
height=(N%H).toString();
width=Math.floor(N/H)+1;
}
if(Math.floor(width/10)===0){//๋ฐฉ ๋ฒํธ๊ฐ 1์ ์๋ฆฌ์ผ ๊ฒฝ์ฐ
console.log(height+'0'+width.toString());
}else{//๋ฐฉ ๋ฒํธ๊ฐ 10์ ์๋ฆฌ์ผ ๊ฒฝ์ฐ
console.log(height+width.toString());
}
}