# Beamer: Algorithm on slide with input and output

I have the following code for printing out an algorithm

However, I would like to have Input and Output before the For Loop.

E.g. Input: ingredients I = (1, \ldots, N), Output: Pizza

Is there an elegant solution for this?

\documentclass[12pt]{beamer}
\usepackage{algorithm,algorithmic}

\begin{document}

\begin{frame}

\begin{algorithm}[H]
\begin{algorithmic}[1]
\FOR{$j=1$ to $N$}
\ENDFOR
\end{algorithmic}
\caption{pseudocode for making a pizza}
\label{alg:seq}
\end{algorithm}
\end{frame}

\end{document}


Something like this?

\documentclass[12pt]{beamer}
\usepackage{algorithm,algorithmic}

\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}

\begin{document}

\begin{frame}

\begin{algorithm}[H]
\begin{algorithmic}[1]
\REQUIRE ingredients I = (1, \ldots, N)
\ENSURE not Pizza
\FOR{$j=1$ to $N$}