how to solve lcm by using diagram