Base ten positive integers P, Q, R, S and T together uses the base ten digits 1, 3, 5, 6, 7 and 9 *precisely twice*.

What are the respective minimum and maximum values of P*Q*R*S*T?

*** None of P,Q,R, S can contain the digits 0,2,4,6,8.

I started by figuring out the possible lengths of five numbers using twelve digits. I got the following twelve distributions: 8-1-1-1-1, 7-2-1-1-1, 6-3-1-1-1, 6-2-2-1-1, 5-4-1-1-1, 5-3-2-1-1, 5-2-2-2-1, 4-4-2-1-1, 4-3-3-1-1, 4-3-2-2-1, 4-2-2-2-2, 3-3-2-2-2.

For each distribution I created a template of the numbers left-aligned, for example the 6-2-2-1-1 template is:

XXXXXX

XX

XX

X

X

To find the minimum product start with the leftmost column and place the five smallest digits available in descending order. Repeat for each column working to the right. For the 6-2-2-1-1 template this yielded:

567799

36

35

1

1

This product is 715,426,740, which is the smallest for the 6-2-2-1-1 template.

Over all 12 templates the absolute smallest occurred for the 8-1-1-1-1 template yielding:

55667799

3

3

1

1

This product is **501,010,191**. This set of numbers satisfies the constraint that implies both 6s are in the same number.

To find the largest product the same templates are used but taking the largest available digits each time, with the first column in ascending order and the other columns in descending order. The absolute maximum product occurs with the 3-3-2-2-2 template:

661

751

75

93

93

This product is **322,009,405,425**. Again, this set of numbers satisfies the constraint that implies both 6s are in the same number.