I want to create something like that
Clearly every element should be coherent with eachother and line need to be connected. This is a MWE, how should I modify it to make it coherent:
\documentclass{beamer}
\mode<presentation>
\usetheme{Warsaw}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}
\[
\begin{array}{c|c}
x_i & lat_i \\
\hline
\end{array}
\]
\[
\left.\begin{array}{c|c}
t_1 & lat_1 \\
\hline
t_2 & lat_2 \\
\end{array}
\right\rbrace = a
\]\[
\left.\begin{array}{c|c}
t_3 & lat_3 \\
\hline
t_4 & lat_4 \\
\end{array}
\right\rbrace = b
\]
\end{frame}
\end{document}

