Let $X$ be a $4$-tuple of matching entries, so $X = (x, x, x, x)$. Let $C$ be a collection of $4$-tuples such that $(a,b,c,d) \in C \implies a+b+c+d \leq 4x$ where $X$ must be an element of $C$, and no two $4$-tuples in $C$ have the same $a$,$b$,$c$, or $d$ value.
Let $f(X)$ be defined as the maximum possible cardinality of $C$. How would you find a closed form expression for $f(X)$?
So for example, if $X = (10,10,10,10)$, a possible maximal set $C$ would be
$$C = \{ (10,10,10,10), (1,13,13,13), (13,1,12,12), (12,12,1,11), (11,11,11,1), (2,9,9,9),\\ (9,2,8,8), (8,8,2,7), (7,7,7,2), (3,6,6,6), (6,3,5,5), (5,5,3,4), (4,4,4,3) \}\;,$$
where $|C| = 13$.