def decompose_on_factors(c, ary)
      f1, *fs = ary
      k, *coeffs = f1.gcd_ext_all(*fs)
      q, r = c.divmod(k)
      unless r.zero?
        print 'c = '
        p c
        print 'k = '
        p k
        print 'ary = '
        p ary
        raise "#{c} is not expressed by parameters"
      end
      d1, *ds = coeffs.collect { |x| x * q }
      [d1] + ds # this is ok
    end
def decompose_on_factors(c, ary)
      f1, *fs = ary
      k, *coeffs = f1.gcd_ext_all(*fs)
      q, r = c.divmod(k)
      unless r.zero?
        print 'c = '
        p c
        print 'k = '
        p k
        print 'ary = '
        p ary
        raise "#{c} is not expressed by parameters"
      end
      d1, *ds = coeffs.collect { |x| x * q }
      [d1] + ds # this is ok
    end
return coeffs s.t. coeffs.inner_product(ary) == c
 entries of c and ary must be euclidian ring