Source: https://kam.mff.cuni.cz/~fiala/papers/dis.pdf