I remember solving problem here on cf from some round: given $$$n$$$ segments $$$L_i, R_i$$$ and number $$$X$$$. Calculate count of ways to make $$$X$$$ as sum of $$$n$$$ numbers where $$$i$$$-th number belongs to $$$i$$$-th segment. $$$n \leq 20$$$; $$$X \leq 10^{18}$$$.
I've failed to find it in the archive by tags, please help.