\begin{longtable}{|r|l|c|r|{% for p in problemy %}c@{\hskip.5em}{% endfor %}|r|r|}\hline
\begin{longtable}{|r|l|c|r|{% for p in problemy %}c@{\hskip.5em}{% endfor %}|r|r|}\hline
&&&&\multicolumn{{{ problemy|length}}}{c|}{\textbf{Úlohy}}&&\\\textbf{Poř.}&\textbf{Jméno}&\textbf{R.}&\raisebox{0.7mm}{$\sum_{-1}$}&{% for p in problemy %}{% if p.typ == "uloha" %}\textbf{r{{p.kod}}}&{% elif p.typ = "tema" %}\textbf{t{{p.kod}}}&{% else %}\textbf{{{p.kod}}}&{% endif %}{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline
&&&&\multicolumn{{{ problemy|length}}}{c|}{\textbf{Úlohy}}&&\\\textbf{Poř.}&\textbf{Jméno}&\textbf{R.}&\raisebox{0.7mm}{$\sum_{-1}$}&{% for p in problemy %}{% if p.typ == "uloha" %}\textbf{r{{p.kod}}}&{% elif p.typ = "tema" %}\textbf{t{{p.kod}}}&{% else %}\textbf{{{p.kod}}}&{% endif %}{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline