Floods in Algeria and Morocco kill 31