  Considering a natural generalization of the Ruzsa-Szemer\'edi problem, we
prove that for any fixed positive integers $r,s$ with $r<s$, there are graphs
on $n$ vertices containing $n^{r}e^{-O(\sqrt{\log{n}})}=n^{r-o(1)}$ copies of
$K_s$ such that any $K_r$ is contained in at most one $K_s$. We also give
bounds for the generalized rainbow Tur\'an problem $\operatorname{ex}(n,
H,$rainbow-$F)$ when $F$ is complete. In particular, we answer a question of
Gerbner, M\'esz\'aros, Methuku and Palmer, showing that there are properly
edge-coloured graphs on $n$ vertices with $n^{r-1-o(1)}$ copies of $K_r$ such
that no $K_r$ is rainbow.
