There are n cities $c_1,c_2,...c_n$(in decreasing order of popularity) where a company wants to open its N branches. There is cost $w_i$ for opening a branch in city $c_i$. If company has budget W , how it should open its branches such that maximum number of branches should be opened in most popular cities. A maximum of $k_i$ number of branches can be opened in city $c_i$.
I can formulate it as a linear programming problem but can't figure how to address the issue of maximum number of branches in most popular cities.