Algorithms for water resources distribution in international river basins