Collision Avoidance for Multi-Joint Manipulators: Divide and Conquer Approach by Determining Intermediate Goals