  We study finding and listing $k$-cliques in a graph, for constant $k\geq 3$,
a fundamental problem of both theoretical and practical importance.
  Our main contribution is a new output-sensitive algorithm for listing
$k$-cliques in graphs, for arbitrary $k\geq 3$, coupled with lower bounds based
on standard fine-grained assumptions, showing that our algorithm's running time
is tight. Previously, the only known conditionally optimal output-sensitive
algorithms were for the case of $3$-cliques by Bj\"{o}rklund, Pagh, Vassilevska
W. and Zwick [ICALP'14].
  Typical inputs to subgraph isomorphism or listing problems are measured by
the number of nodes $n$ or the number of edges $m$. Our framework is very
general in that it gives $k$-clique listing algorithms whose running times are
measured in terms of the number of $\ell$-cliques $\Delta_\ell$ in the graph
for any $1\leq \ell<k$. This generalizes the typical parameterization in terms
of $n$ (the number of $1$-cliques) and $m$ (the number of $2$-cliques).
  If the matrix multiplication exponent $\omega$ is $2$, and if the size of the
output, $\Delta_k$, is sufficiently large, then for every $\ell<k$, the running
time of our algorithm for listing $k$-cliques is
$$\tilde{O}\left(\Delta_\ell^{\frac{2}{\ell (k -
\ell)}}\Delta_k^{1-\frac{2}{k(k-\ell)}}\right).$$ For sufficiently large
$\Delta_k$, we prove that this runtime is in fact {\em optimal} for all $1 \leq
\ell < k$ under the Exact $k$-Clique hypothesis.
  In the special cases of $k = 4$ and $5$, our algorithm in terms of $n$ is
conditionally optimal for all values of $\Delta_k$ if $\omega = 2$. Moreover,
our framework is powerful enough to provide an improvement upon the 19-year old
runtimes for $4$ and $5$-clique detection in $m$-edge graphs, as a function of
$m$ [Eisenbrand and Grandoni, TCS'04].
