Worked in same state all year, but lived in two states. How to enter the W-2 info?

I had the same job all year in NY city. I lived in NY city for the first nine months then moved to NJ.

I received a two-page W-2, one has a NJ State Wage and Tax statement and the other has a NY State Wage and Tax statement and a City Wage and Tax statement.

Is there a way to go a TT section which will walk me through, step by step, a situation like this?