A wire is cut into two pieces. One piece is bent to form a square, and the other piece is bent to form a regular octagon. If the perimeters of the square and the octagon are equal, what is the ratio of the area of the square to the area of the octagon?