Maximizing Profits in Smart Cities