\documentclass{article}
\input{preamble}
\title{Questionable Quadrupling - MathGames}

\begin{document}

\maketitle
{\bf Difficulty:} \stars{2}\\
{\bf Key words: Algebra, Probability Theory} \\

One of your friends Quincy has thought of an interesting way to quadruple the outcome of a die roll. Instead of rolling the die once and quadrupling it, he rolls the die four times and adds the rolls together. Given the discrete distribution of the quadrupled rolls, can you determine the faces of the die? All faces of the die are different integers.
\vspace{0.5cm}

{\Large \textbf Input}
\begin{itemize}
    \item The first line contains a single integer $1 \leq n < 100$, the number of unique quadrupling outcomes.
    \item Next follow $n$ lines with two space-separated integers $-10^5 \leq q_i \leq 10^5$ and $1 \leq k_i < 10^4$, the quadrupling outcome and for how many tuples of four original rolls the sum $q_i$ is attained. These lines are sorted in increasing order of $q_i$ and the sum of all $k_i$ does not exceed $10^4$.
\end{itemize}

{\Large \textbf Output}
\begin{itemize}
    \item The first line should contain a single integer $m$, the number of faces of the original die.
    \item Next, output $m$ lines containing a single integer $f_i$, denoting the faces of the die in increasing order.
\end{itemize}


{\Large \textbf Examples}\\
\begin{center}
\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
1 & 1\\
4 1 & 1\\\hline
\end{tabular}
}

\vspace{1em}

\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
5 & 2\\
0 1 & 0\\
1 4 & 1\\
2 6 & \\
3 4 & \\
4 1 & \\\hline
\end{tabular}
}
\end{center}


\end{document}