\documentclass[11pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amscd}
\usepackage{amssymb}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{url}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage[a4paper,margin=2.5cm,hmarginratio=1:1]{geometry}
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% ENTER YOUR PERSONAL INFORMATION HERE %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The info of your group members. Set Y and Z empty if you are not
% three.
\newcommand{\persnrX}{pno}
\newcommand{\nameX}{Name}
\newcommand{\familynameX}{Lastname}
\newcommand{\emailX}{username@kth.se}

\newcommand{\persnrY}{}
\newcommand{\nameY}{}
\newcommand{\familynameY}{}
\newcommand{\emailY}{}

\newcommand{\persnrZ}{}
\newcommand{\nameZ}{}
\newcommand{\familynameZ}{}
\newcommand{\emailZ}{}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% DO NOT TOUCH ANYTHING BELOW THIS LINE %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcounter{problem}
\renewcommand\theproblem{\arabic{problem}}
\newenvironment{problem}{%
	\bigbreak
	\refstepcounter{problem}\noindent
	\llap{\textbf{\theproblem}\quad}\ignorespaces
}{%
	\par\if@nadaten@solutions\relax\else\filbreak\fi
}
\newenvironment{problem*}{%
	\bigbreak
	\refstepcounter{problem}\noindent
	\llap{\textbf{\theproblem}\quad}\ignorespaces
}{%
	\par
}
\newcounter{subproblem}[problem]
\renewcommand{\thesubproblem}{\arabic{problem}\alph{subproblem}}
\newenvironment{subproblem}{%
	\refstepcounter{subproblem}%
	\list{}{}%
	\item\leavevmode
	\llap{\hbox to \leftmargini{\textbf{\thesubproblem}\hfil}}%
	\ignorespaces
}{%
	\endlist\if@nadaten@solutions\relax\else\filbreak\fi
}
\newenvironment{subproblem*}{%
	\refstepcounter{subproblem}%
	\list{}{}%
	\item\leavevmode
	\llap{\hbox to \leftmargini{\textbf{\thesubproblem}\hfil}}%
	\ignorespaces
}{%
	\endlist
}

\newcommand{\homeworknr}{II}
\newcommand{\homework}{Homework~\homeworknr}
\newcommand{\coursenumber}{DD2448}
\newcommand{\coursename}{\coursenumber~Foundations of cryptography}
\newcommand{\coursenick}{krypto17}

\lhead[\familynameX~\familynameY~\familynameZ]{\coursename}
\chead{}
\rhead[\coursename]{\familynameX~\familynameY~\familynameZ}
\lfoot[\thepage~(\pageref{LastPage})]{}
\cfoot{}
\rfoot[]{\thepage~(\pageref{LastPage})}

\fancypagestyle{firststyle}
{
	 \fancyhf{}
	 \fancyfoot[R]{\thepage~(\pageref{LastPage})}
}

\renewcommand{\headrulewidth}{0pt}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% HERE YOU CAN ADD YOUR OWN MACROS AND ENVIRONMENTS IN THE PREAMBLE %%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Add your macros here.

\newcommand{\TPOINTS}[1]{(#1T)}
\newcommand{\IPOINTS}[1]{(#1I)}

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% THE FOLLOWING GENERATES THE HEADER %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%% DO NOT TOUCH THIS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\thispagestyle{firststyle}

\noindent
\hspace{0.3cm}{\huge\textbf{\coursename}}

\noindent
\rule{\textwidth}{1pt}

\noindent
\begin{tabularx}{\textwidth}{X|lll}
	& \textbf{Persnr} & \textbf{Name} & \textbf{Email} \\
\cline{2-4}
&\\[-0.3cm]
	\multirow{2}{*}{\textbf{\huge\homework}} & {\small\persnrX} & {\small\nameX} & {\small\emailX} \\
	& & {\small\familynameX} & \\
	\multirow{2}{*}{\textbf{\huge\coursenick}} & {\small\persnrY} & {\small\nameY} & {\small\emailY} \\
	& & {\small\familynameY} & \\
	& {\small\persnrZ} & {\small\nameZ} & {\small\emailZ} \\
	& & {\small\familynameZ} & \\
&\\
[-0.2cm]
\end{tabularx}

\vspace{0.2cm}
\noindent
\rule{\textwidth}{1pt}

\vspace{0.5cm}

\pagestyle{fancy}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%% YOUR SOLUTIONS START HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                       %%
%%  Do NOT remove any problem-, or subproblem environments, or nominal   %%
%%  points below. If you can not solve a problem, then you MUST simply   %%
%%  leave the "NOT SOLVED" string intact. This ensures that the          %%
%%  numbering is correct and it simplifies grading, leaving more time    %%
%%  to prepare lectures and help students.                               %%
%%                                                                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{problem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{2} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{3} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{2} NOT SOLVED
	\end{subproblem}
\end{problem}

\begin{problem}
	\begin{subproblem}
		\TPOINTS{2} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{3} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{2} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{3} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{3} NOT SOLVED
	\end{subproblem}
\end{problem}

\begin{problem}
	\TPOINTS{4} NOT SOLVED
\end{problem}

\begin{problem}
	\IPOINTS{12} NOT SOLVED
\end{problem}

\begin{problem}
	\IPOINTS{7} NOT SOLVED
\end{problem}

\begin{problem}
	\IPOINTS{10} NOT SOLVED
\end{problem}

\begin{problem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{1} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{2} NOT SOLVED
	\end{subproblem}
\end{problem}

\begin{problem}
	\TPOINTS{4} NOT SOLVED
\end{problem}

\begin{problem}
	\TPOINTS{3} NOT SOLVED
\end{problem}

\begin{problem}
	\begin{subproblem}
		\TPOINTS{4} NOT SOLVED
	\end{subproblem}
	\begin{subproblem}
		\TPOINTS{4} NOT SOLVED
	\end{subproblem}
\end{problem}

\end{document}

