If your New Year's resolution is to live healthy, you might want to move. A new study shows Salt Lake City is the healthiest city for women, while Madison, Wis., is the best place for men.

Men's Health and Women's Health magazines looked at 100 of the largest U.S. cities and ranked the best and worst for men and women by looking at 38 different factors, including cancer rates, air quality and the number of gym memberships.

According to the study the worst place to live for women is Bakersfield, Calif., and Charleston, W.Va., is the unhealthiest place for men.

Seven cities are in the top 10 for both men and women -- Aurora, Colo.; Madison, Wis.; Minneapolis; San Francisco and San Jose, Calif.; Salt Lake City and Seattle.

In the bottom 10 spots Bakersfield, Calif.; Birmingham, Ala.; Charleston, W.Va.; Detroit; Memphis, Tennessee; St. Louis and St. Petersburg, Fla., make an appearance on both lists.

The magazine said the study focused on cities, not their suburbs, and used data from sources such as the Centers for Disease Control and Prevention, the Census Bureau, the FBI and the U.S. Department of Labor.

The complete lists of the healthy and unhealthiest cities for men and women can be seen at www.menshealth.com and www.womenshealth.com.