Jan spends part of her year as a member of a gym. She then finds a better deal at another gym, so she cancels her membership with the first gym after x months and spends the rest of the year, y months, with the second gym. The membership to the first gym costs $60 per month, while the membership for the second gym costs $50 per month. If she ended up spending a total of $660 over the course of the year, how much time did she spend at each gym?