solution

$R \le 100$なので$4R^2 \le 40000$マスぐらいを見れば尽くせる。$O({(\frac{R}{C})}^2)$。

implementation

#!/usr/bin/env python3
r, c = map(int, input().split())
cnt = 0
for ly in range(0, r, c):
    for lx in range(0, r, c):
        pred = True
        for y, x in [ (ly, lx), (ly, lx+c), (ly+c, lx), (ly+c, lx+c) ]:
            if y**2 + x**2 > r**2:
                pred = False
                break
        if pred:
            cnt += 1
print(cnt * 4)