% !Mode:: "TeX:UTF-8"
% !TEX encoding = UTF-8 Unicode

\begin{center}
  \begin{tikzpicture}[background rectangle/.style={fill=black!5!white,rounded corners=5pt,minimum width=\textwidth}, show background rectangle]
    % rule of math
    \begin{scope}[yshift=-6cm]
      \matrix (m) [matrix anchor=west,
      matrix of nodes,
      nodes={anchor=north west,}
      ] at (-\textwidth/2,0) {
        \color{gray}{Input} &
        \begin{varwidth}{18em}
          \small{Weng earns \$12 an hour for babysitting. Yesterday, she just did 50 minutes of babysitting. How much did she earn? (\textbf{Answer is 10})}
        \end{varwidth} \\
        \color{gray}{Output 1} &
        \begin{varwidth}{18em}
          \small{Weng earns 12/60 = \$0.2 per minute. Working 50 minutes, she earned 0.2 x 50 = \$10. \\
            \#\#\#\# \boxed{10} (\textbf{Res: 10})
          }
        \end{varwidth} \\
        \color{gray}{Output 2} &
        \begin{varwidth}{18em}
          \small{To find out how much Weng earned from the 50 minutes of babysitting, we need ... \\
            50 minutes x \$12 per hour = \$600 \\
            So, Weng earned \$600 from the 50 minutes of babysitting.\\
            \#\#\#\# \boxed{600} (\textbf{Res: 600})
          }
        \end{varwidth} \\
      };

      \path let \p1=($(m-2-2.north east)-(m-3-2.south east)$) in node [minimum height=\y1,minimum width=2cm,draw,anchor=north west,rounded corners=2pt,align=center] (counter) at ([xshift=1cm]m-2-2.north east) {Answer\\Verification};

      \node at ([xshift=4.5cm]m-1-2.east) {Reward};
      \node (res1) at ([xshift=4.5cm]m-2-2.east) {\textbf{+1}};
      \node (res2) at ([xshift=4.5cm]m-3-2.east) {\textbf{-1}};

      \draw [->] (m-2-2.east) -- ([xshift=-.1cm]counter.west |- m-2-2.east);
      \draw [->] (m-3-2.east) -- ([xshift=-.1cm]counter.west |- m-3-2.east);
      \draw [->] ([xshift=.1cm]counter.east|-m-2-2.east) -- (res1.west);
      \draw [->] ([xshift=.1cm]counter.east|-m-3-2.east) -- (res2.west);
    \end{scope}
  \end{tikzpicture}
\end{center}
