algorithm for floood cities protection ready