solution to rainfall problem