%https://math.stackexchange.com/questions/1794726/rational-solutions-of-x3y3-9

% Impossible for A = B is quite hard to show but can be derived from example case 1 1 (by scaling) 0 A is impossible by Fermats Last Theorem
\documentclass{article}
\input{preamble}
\title{Rational Refill - MathGames}

\begin{document}

\maketitle
{\bf Difficulty:} \stars{5}\\
{\bf Key words: Number Theory} \\
The world's leading expert on everything except matter usually stores his antimatter in two spherical containers of radius $A$ and $B$, respectively. However, due to some cosmic fluctuations, storing antimatter in containers of these sizes is no longer safe and the antimatter needs to be transferred to containers of different sizes. Due to its unpredictable nature, antimatter must be stored in two completely full, spherical containers of rational radii. Hence, your task is to determine if it is possible to create two spherical containers of different, rational radii, that can be completely filled with the original antimatter.\\

{\Large \textbf Input}
\begin{itemize}
    \item Two space-separated integers $0 \leq A, B \leq 10^6, \ B \neq 0$, the radii of the original containers.
\end{itemize}

{\Large \textbf Output}
\begin{itemize}
    \item Two line-separated non-negative rationals, the radii of the new containers. Output each rational as its numerator, followed by a '/', followed by its denominator. An integer $n$ should be output as $n$/1. If such rationals do not exist, output \texttt{impossible}. If there are multiple answers, you may give any one of them.
\end{itemize}


{\Large \textbf Examples}\\
\begin{center}
\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
1 2 & 676702467503/348671682660\\
& 415280564497/348671682660\\ \hline
\end{tabular}
}

\vspace{1em}

\scalebox{1.5}{
\begin{tabular}{|l|l|}
\hline
Input & Output \\ \hline
1 1 & impossible\\\hline
\end{tabular}
}
\end{center}


\end{document}