Simple algorithms for reactive power planning in transmission and distribution systems