Prediction of floods and droughts is an effective measure for adapting to climate change