# Almost all the pairwise products

Algebra Level 5

Let $$a, b, c, d$$ be positive integers such that $$a+b+c+d=120,$$ and define $S=ab+bd+da+bc+cd.$ Find the number of ordered quadruples $$(a,b,c,d)$$ for which $$S$$ attains its maximum.

×