public long solution(int k, int d) {
long answer = 0;
long max_x = d / k;
for (long x = 0; x <= max_x; x++) {
answer += (long) Math.sqrt((double) d * d - x * x * k * k) / k + 1;
}
return answer;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/140107