Solution (source code)

= Solution

First rotate rows $2,3$ with $c=4/5$, $s=3/5$. The second column pair $(4,3)$ becomes $(5,0)$ and the corresponding third column pair $(1,2)$ becomes $(2,1)$. Next rotate rows $3,4$ with $c=4/5$, $s=3/5$, sending the third column pair $(1,3/4)$ to $(5/4,0)$. Thus $R=G_{34}G_{23}A$ and $Q=G_{23}^TG_{34}^T$. \b[One exact <QR decomposition> is]
$$
\boxed{R=\begin{pmatrix}3&1&1\\0&5&2\\0&0&5/4\\0&0&0\end{pmatrix},\qquad
Q=\begin{pmatrix}
1&0&0&0\\
0&4/5&-12/25&9/25\\
0&3/5&16/25&-12/25\\
0&0&3/5&4/5
\end{pmatrix}.}
$$
The construction proves $Q^TQ=I$, and direct multiplication checks $QR=A$.