The court heard arguments in a long and winding case about whether congressional and state legislative districts were drawn to discriminate.