bīng​lái​jiàng​dí​shuǐ​lái​tǔ​yàn

to adopt measures appropriate to the situation