Arbitrage opportunity interview question

I have seen this interview question mentioned in a couple of places:

There are three call options on the market, with the same expiry and with strikes 10, 20, and 30. Suppose the call option with strike 10 costs \$12, the call option with strike 20 costs \$7, and the call option with strike 30 costs \$1. Is there an arbitrage opportunity? The answer apparently is to buy two of the call options priced at \$20, and sell one of each of the call options priced at \$10 and \$30.

How does one arrive at this answer and is it unique?

Thanks.

A similar question for put option has been discussed in this question: Finding Arbitrage in two Puts. Basically, the call option payoff is a convex function of the strike. Then the call option price is also a convex function of the strike. Specifically, let $C(K)$ denote the call option price with strike $K$. Then for $0 < K_1 < K_2$, \begin{align*} C\left(\frac{K_1 + K_2}{2}\right) \le \frac{1}{2}\big(C(K_1) + C(K_2) \big). \end{align*}
For the example, let $K_1 = 10$ and $K_2 = 30$. Then \begin{align*} C(20) &= C\left(\frac{K_1 + K_2}{2}\right)\\ &\le \frac{1}{2}\big(C(K_1) + C(K_2) \big)\\ &= \frac{1}{2} (12 + 1) = 6.5. \end{align*} However, $C(20) = 7$, which contradicts to the above. Therefore, there is an arbitrage opportunity.
For an arbitrage strategy, we should short (i.e., sell) the option that is over-priced, and long (i.e., buy) the option that is under-priced. Specifically, we short two options with strike 20, and long one option with strike 10 and long another option with strike 30. At the start, we have the profit \begin{align*} 2 \times 7 - 12 - 1 = 1 . \end{align*} At the option maturity, the payoff to us is \begin{align*} (S_T-10)^+ + (S_T-30)^+ - 2 (S_T-20)^+ = \begin{cases} 0, & \mbox{if } S_T \leq 10,\\ S_T-10, & \mbox{if } 10 \le S_T \le 20, \\ 30-S_T, & \mbox{if } 20\le S_T \le 30,\\ 0 , & \mbox{if } S_T \ge 30, \end{cases} \end{align*} which is always non-negative. Then, we have a guaranteed profit at the start and potential further profit at the option maturity, while without any liabilities. • Question about the payoff at maturity. Why is the payoff 0 when S_T is greater than 30? I thought that since we have the option to buy at 30, we would make money if the stock price is greater than 30. – Wokwok Dec 14 '15 at 23:17 • IfS_T\$ above 30 You make on the K=30 and the K=10, but you lose on the two K=20 that you are short. So you gain nothing. – Alex C Dec 14 '15 at 23:25