\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 %}\textbf{{{ p.kod_v_rocniku }}}&{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline
&&&&\multicolumn{{{ problemy|length}}}{c|}{\textbf{Témata}}&&\\\textbf{Poř.}&\textbf{Jméno}&\textbf{R.}&\raisebox{0.7mm}{$\sum_{-1}$}&{% for p in problemy %}\textbf{{{ p.kod_v_rocniku }}}&{% endfor %}\raisebox{0.7mm}{$\sum_0$}&\raisebox{0.7mm}{$\sum_1$}\\\hline