Solve problem 36 using Rust.