def lcm_go
import bend-collections-laws-crypto@1.0.0.0/spec/math/generic.bend as Genericimport Base
import bend-collections-laws-crypto@1.0.0.0/src/math/natural.bend as M
130def lcm_go(+w: Nat, xs: List<&2, Nat>, +acc: Nat, ok: Bool) -> Nat & Bool:
131 match xs ok:
132 case Nil{} _:
133 (acc, ok)
134 case Con{x, t} False{}:
135 (acc, False{})
136 case Con{+x, t} True{}:
137 lcm_go(w, t, M.lcm(acc, x), fits(w, M.lcm(acc, x)))