Solving algebraic equations p=2w+2l problems