let i = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n').slice(0, -1).map((e) => e-0) f = (w, d) => { let r = Math.floor(w/d/d) if (d == 1) return r return f(w-r, d-1) } console.log(f(i[0], i[1]))