Solve problems 9,16 using Rust.