Solving problems using ratio