Optimal Gateway Placement In Low-Cost Smart Cities