臨機応変 (りんきおうへん): adapting oneself to the requirements of the moment; playing by ear

adapting oneself to the requirements of the moment; playing by ear

Meet the moment and change with it. High praise at work for someone who dropped the plan the instant the plan stopped fitting.

The same saying in Chinese: 随机应变