The plan for a gym membership will be a linear equation, in the form y=mx+b, where b is the base fee, m is the cost per month, and y is the total cost. As long as the graph of this line for both gyms intersect, this point of intersection is where the cost for both gyms intersect. If you have two parallel lines, however, there will be no point of intersection.
For example, Gym A charges a $20 base fee plus $20 for each month. Gym B charges a $25 base fee plus $20 for each month. These are parallel and will never intersect.