You'd have to write equations for the price per month for each club.
Let x equal the number of months of membership, and y equal the total cost.
Club A's is y = 21x + 12 and Club B's is y = 20x + 16
Because we know that the prices, y, would be equal, we can set the two equations equal to each other.
21x + 12 = 20x + 16
Subtract 12 from both sides
21x = 20x + 4
Subtract 20x from both sides
x = 4
After four months, the total cost would be the same.
Now for the total cost just place in 4 for X
Club A - y = 21x + 12
y = 21(4) + 12
y = 84 + 12
y = 96
Club B - y = 20x + 16
y = 20(4)+ 16
y = 80 + 16
y = 96