% ---- PAGE GEOMETRY ----
\usepackage[a4paper,top=3cm,bottom=2.5cm,left=2cm,right=2cm,headheight=2.2cm,headsep=0.6cm]{geometry}
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}

% ---- TITLE / SECTION STYLE ----
\usepackage[nobottomtitles*]{titlesec}
\titleformat{\section}
  {\fontsize{16}{16}\sffamily\bfseries}
  {}{0pt}{}
\titlespacing{\section}{0pt}{0pt}{0.8em}
\newcommand{\tl}{}
\newcommand{\ml}{}
\newcommand{\problemtitle}[1]{%
  \section[#1]{#1 \hfill \normalfont\fontsize{12}{12}\selectfont{Time limit: \tl\qquad Memory limit: \ml}}
}

\usepackage[dvipsnames]{xcolor}
\titleformat{\subsection}
  {\fontsize{13}{13}\bfseries\itshape}
  {}{0pt}{}
  [\vspace{-0.9em}{\color{NavyBlue}\rule{0.18\textwidth}{0.16em}}\vspace{-0.6em}]
\titlespacing{\subsection}{0pt}{0.8em}{0.3em}

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

% ---- CODE LISTINGS ----
\usepackage{listings}
\definecolor{lstbg}{RGB}{248,248,250}
\definecolor{lstframe}{RGB}{210,210,218}
\lstdefinestyle{mystyle}{
  backgroundcolor=\color{lstbg},
  frame=single,
  rulecolor=\color{lstframe},
  basicstyle=\ttfamily\small,
  breaklines=true,
  aboveskip=0.6\baselineskip,
  belowskip=0.2\baselineskip
}
\lstset{style=mystyle}

% ---- HEADER / FOOTER ----
\usepackage{fancyhdr}
\pagestyle{fancy}
\newcommand{\header}{}
\fancyhead[L]{\bfseries Vasile}
\fancyhead[C]{\centering\normalfont\small \header}
\fancyhead[R]{}
\renewcommand{\headrulewidth}{0.4pt}
\usepackage{lastpage}
\fancyfoot[C]{\thepage\ / \pageref*{LastPage}}
\raggedbottom

% ---- MATH ----
\usepackage{amsmath}
\usepackage{stmaryrd}

% ---- IMAGES ----
\usepackage{graphicx}
\graphicspath{{./}}
\usepackage{float}
\usepackage{placeins}
\usepackage{caption}
\captionsetup{skip=0.3em, font=it}

% ---- TABLES ----
\usepackage{makecell}
\usepackage{tabularray}
\AtBeginEnvironment{table}{\vspace{-0.2cm}}
\AtEndEnvironment{table}{\vspace{-0.2cm}}

% ---- LISTS ----
\usepackage{enumitem}
\setlist{itemsep=2pt, leftmargin=1.4em, topsep=2pt}

% ---- LINKS ----
\usepackage{hyperref}
\hypersetup{colorlinks=true, citecolor=blue, linkcolor=blue, urlcolor=blue}
