Switching in time-optimal problem