Skip to main content
2 of 3
deleted 8 characters in body
G B
  • 22.8k
  • 1
  • 20
  • 53

Ruby, 88 bytes

->a,b{*r=0,0,w=-a*b;(k=*w..-w).product(k).map{|x,y|r[w*w<=>x*x+y*y]+=1[x%a+y%b]};r[0,2]}

Try it online!

G B
  • 22.8k
  • 1
  • 20
  • 53