[백준] 10250번 : ACM 호텔 - Javascript(자바스크립트)

강재원·2022년 10월 2일
0



https://www.acmicpc.net/problem/10250

const fs=require('fs')
ip=fs.readFileSync(0).toString().split('\n')
t=parseInt(ip[0])
for(i=1;i<=t;i++){
    v=ip[i].split(' ').map(Number)
    h=parseInt(v[0])
    w=parseInt(v[1])
    n=parseInt(v[2])
    if(n%h==0){
        if(parseInt(n/h)<10) console.log(`${h}0${parseInt(n/h)}`)
        else console.log(`${h}${parseInt(n/h)}`)
    } 
    else{
        if(parseInt(n/h)+1<10) console.log(`${n%h}0${parseInt(n/h)+1}`)
        else console.log(`${n%h}${parseInt(n/h)+1}`)
    } 
}
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글