Water supply of high-rise buildings requires pump systems to ensure pressure requirements. The design goal of these systems are energy and cost efficiency, both in terms of fixed cost as well as during operation. In this paper, cost optimal decentralized and tree-shaped water distribution networks are computed, where placements of pumps at different locations in the building are allowed. We propose a branch-and-bound algorithm for solving the corresponding mixed-integer nonlinear program, which exploits problem specific structure and outperforms state-of-the-art solvers. A further desirable feature is that the system is K-resilient, i.e., still be able to operate under K pump failures during the use phase. Using a characterization of resilient solutions via a system of inequalities, the branch-and-bound scheme is extended by a separation algorithm to produce cost optimal resilient solutions. This implicitly solves a multilevel optimization problem which contains the computation of worst-case failures. Moreover, using a large set of test instances, the increased energy-efficiency of decentralized networks for the supply of building is shown and properties of resilient layouts are discussed.