title: How to find all sums of two sets in O(nlogn) time (arithmetic and comparisons)
body: <p>If sets A, B are subsets of {1, ..., n}, how would I find all elements of the set {a + b: a ∈ A, b ∈ B} in O(nlogn) time (arithmetic and comparisons)?</p>