Level
프로그래머스 Lv2
Recruitment
Summer/Winter Coding
function solution(w, h) {
  var answer = w * h;

  if (w === h) {
    return answer - w;
  }

  for (let i = 0; i < h; i++) {
    answer -= Math.ceil(((i + 1) * w) / h) - Math.floor((i * w) / h);
  }

  return answer;
}