Soln to chap 6 ex4c of Kleinberg and Tardos Algorithm Design book.