Each element of set $B$ must be mapped to at least one element of set $A$, and we need to count how many such functions are possible.
We have 6 elements in set $A$ and 3 elements in set $B$. The condition is that each element in $B$ must have at least one pre-image in $A$, so we are looking for surjections (onto functions).
The total number of surjections from a set of size 6 to a set of size 3 can be calculated using the inclusion-exclusion principle.
The number of surjections from a set of size 6 to a set of size 3 is given by:
$3^6 - \binom{3}{1} 2^6 + \binom{3}{2} 1^6 = 729 - 192 + 3 = 540$
Thus, the total number of such functions is 540.
Let \( S = \{p_1, p_2, \dots, p_{10}\} \) be the set of the first ten prime numbers. Let \( A = S \cup P \), where \( P \) is the set of all possible products of distinct elements of \( S \). Then the number of all ordered pairs \( (x, y) \), where \( x \in S \), \( y \in A \), and \( x \) divides \( y \), is _________.