Skip to main content
2 of 2
added 1 character in body
jdt
  • 4.5k
  • 1
  • 14
  • 18

C (clang), 84 bytes

*t,m,v,i;f(*r,a,b,c,d){r?t=r,i=m=0:0;v=a/c-b/d;v<m||(m=v,*t=i);i++<4&&f(0,c,a,d,b);}

Try it online!

jdt
  • 4.5k
  • 1
  • 14
  • 18