Dividing the wire into pieces of length and is fine.

However, you should understand that these lengths serve as the circumference (length of the boundary of the circle) and the perimeter (length of the boundary of the rectangle). So, for example, is not the radius of the circle, and therefore your solution is wrong.

See if you can work the problem out with that in mind.