# [Ruby], 88 bytes <!-- language-all: lang-ruby --> ->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!][TIO-lrg4rn2s] [Ruby]: https://www.ruby-lang.org/ [TIO-lrg4rn2s]: https://tio.run/##LcqxCoMwEADQvV/RRdDLJUSLULDnj4QMSYuLlIZDSYL67WnBbm94vPpcJipydOg3YNKoMZJ04Id6JohKydiowJ/X@lzquVFvF7Y9Yd7ZRIgPGhMkkSFbQa1JlRO58vYY2Gjs7FHCdTI93uzlRNufuuMf3a9pW74 "Ruby – Try It Online"