Compute prefix/cumulative product of N × D×D matrices. (1) In-place with complexity analysis + why gradient fails; (2) Out-of-place forward & backward pass; (3) Hillis-Steele scan: use provided HS…