how to solve hcf and lcm problems