%---DOCUMENT MARGINS---
\usepackage{geometry} % Required for adjusting page dimensions and margins
\geometry{
	paper=a4paper, % Paper size, change to letterpaper for US letter size
	top=4cm, % Top margin
	bottom=2cm, % Bottom margin
	left=2cm, % Left margin
	right=2cm, % Right margin
	headheight=4cm, % Header height
	%footskip=1.5cm, % Space from the bottom margin to the baseline of the footer
	headsep=0cm, % Space from the top margin to the baseline of the header
	%showframe, % Uncomment to show how the type block is set on the page
}
\usepackage{cmap}

\usepackage[T1,T2A]{fontenc}
\usepackage{fontspec}
\setmainfont[
	BoldFont={* Bold},
	ItalicFont={* Italic},
	BoldItalicFont={* BoldItalic}
]{DejaVu Serif Condensed}
\setsansfont{DejaVu Sans}
\setmonofont{Dejavu Sans Mono}
\usepackage[math-style=TeX]{unicode-math}
\setmathfont{Latin Modern Math}

\usepackage[nobottomtitles*]{titlesec}
\titleformat
{\section} % command
{\fontsize{12.5}{12.5}\sffamily\bfseries} % format
{} % label
{0pt} % sep
{} % before-code
\titlespacing{\section}{0pt}{0em}{0em}
\newcommand{\tl}{}
\newcommand{\ml}{}
\newcommand{\problem}[1]{%
	\section[#1]{#1 \fontsize{12}{12}{\hfill{\normalfont{
				\emoji{hourglass-not-done}\tl \space\space \emoji{floppy-disk} \ml}}}}
}
\AddToHook{cmd/section/before}{\clearpage}

\usepackage[dvipsnames]{xcolor}
\titleformat
{\subsection} % command
{\fontsize{12.5}{12.5}\itshape} % format
{} % label
{0pt} % sep
{} % before-code
[\vspace{-1em}{\color{RoyalBlue}\rule{0.2\textwidth}{0.2em}}\vspace{-0.7em}] % after-code
\titlespacing{\subsection}{0pt}{0.5em}{0em}

\newcommand{\formatdate}[3]{#1#2#3} % formats as YYYYMMDD
\newcommand{\currentdate}{%
	\formatdate{\the\year}{\ifnum\month<10 0\fi\the\month}{\ifnum\day<10 0\fi\the\day}
}
\newcommand{\addauthor}[4]{%
	\ifnum\currentdate>\formatdate{#2}{#3}{#4}
	{\noindent\hfill\bfseries{#1}}
	\fi
}

\setlength{\parskip}{0.5em}
\setlength{\parindent}{24pt}
\sloppy

\usepackage{listings}
\definecolor{lstbg}{RGB}{250,250,252}
\definecolor{lstframe}{RGB}{220,220,225}
\lstdefinestyle{mystyle}{
	backgroundcolor=\color{lstbg},
	frame=single,
	rulecolor=\color{lstframe},
	basicstyle=\ttfamily\small,
	keywordstyle=\bfseries,
	breaklines=true,
	aboveskip=0.5\baselineskip,
	belowskip=0\baselineskip  
}
\lstset{style=mystyle, language=C++}

\usepackage{fancyhdr}
\pagestyle{fancy}
\newcommand{\headerLang}{}
\newcommand{\headerLeft}{}
\fancyhead[L]{%
	\begin{minipage}{\textwidth}
		\color{RoyalBlue}\bf{
			\headerLeft\\
			\emoji{globe-with-meridians} \normalfont{\headerLang}
		}
		\vspace{1.7cm}
	\end{minipage}
}
\newcommand{\headerRightFirst}{}
\newcommand{\headerRightSecond}{}
\fancyhead[R]{%
	\begin{minipage}{\textwidth}
		\includegraphics[width=3cm, right]{./logo.png}
		\makebox[\linewidth][r]{\color{RoyalBlue}\bf\headerRightFirst}
		\makebox[\linewidth][r]{\color{RoyalBlue}\bf\headerRightSecond}
		\vspace{-0.35cm}
	\end{minipage}
}
\renewcommand{\headrulewidth}{0cm}
\usepackage{lastpage}
\newcommand{\problemName}{}
\fancyfoot[L]{\color{RoyalBlue}Task \problemName}
\fancyfoot[C]{\color{black}\href{https://iati-shu.org}{iati-shu.org}}
\fancyfoot[R]{\color{RoyalBlue}Page \thepage\ of \pageref*{LastPage}}

\raggedbottom

\usepackage{amsmath}
\usepackage{stmaryrd}

\usepackage{graphicx}
\graphicspath{{./}}
\usepackage[export]{adjustbox}
\usepackage{wrapfig}
\makeatletter
\patchcmd\WF@putfigmaybe{\lower\intextsep}{}{}{\fail}
\AddToHook{env/wrapfigure/begin}{\setlength{\intextsep}{0pt}}
\makeatother
\usepackage[inkscapearea=page, inkscapepath=./svg-inkscape]{svg}
\svgpath{{./}}

\usepackage{makecell}
\usepackage{tabularray}
\AtBeginEnvironment{table}{\vspace{-0.2cm}}
\AtEndEnvironment{table}{\vspace{-0.2cm}}
\usepackage{float}
\usepackage{placeins}
\usepackage{caption}
\captionsetup[table]{
	skip=0.25em, font=it,
	singlelinecheck=false, justification=justified, indention=-24pt,
	margin={24pt, 0pt}
}

\usepackage{enumitem}
\setlist{itemsep=-0.4em, leftmargin=\parindent, topsep=-\parskip}
\AfterEndEnvironment{itemize}{\vspace{\parskip}}
\newcommand{\tabitem}{\indent~~\llap{\textbullet}~~}

\usepackage{hyperref}
\hypersetup{
	colorlinks=true,
	citecolor=blue,
	linkcolor=blue,
	urlcolor=black,
}

\usepackage{emoji}