read a b c for((i=a*c;i<=b*c;i+=b-a)){ for((j=c;i%j+c%j;--j)){ :;} s=$[i/j]/$[c/j] printf ${s%/1}\ }