Source: https://theory.stanford.edu/~trevisan/cs154-12/reductions3.pdf