Egyptian officials say rain and sandstorms that battered the country for several days have killed at least 31 people .