Two dams problem explanation