Given the perimeter, calculate x