Flooding caused by torrential rains has killed nearly 40 people and left thousands homeless in Sumatra.

Officials have warned of more landslides if the rain continues.