import math def solution(k, d): answer = 0 for b in range(d//k + 1): a = math.sqrt(d**2 - (b*k)**2) a //= k answer += int(a) + 1 return answer