Optimal weighted estimates of the flows in exterior domains