None of the examples involve finding A given B, but that just means they work either way. But to me the problem statement is clear: "the number of integers $i in the range $from <= $i <= $to that belong to at least $count different shuffle pairs".
Comment on Re^3: Faster (but uglier) PWC 350-2 solutions