\usepackage{ifthen} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{problem}[theorem]{Problem} \newtheorem{definition}[theorem]{Definition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{claim}[theorem]{Claim} \newtheorem{observation}[theorem]{Observation} % #1 (optional): Fixed parameters of the problem % #2: Name of query problem % #3: The structure to preprocess % #4: Questions to handle \newcommand{\queryproblem}[4][]{ \begin{problem} \upshape \textsc{#2} \\ \ifthenelse{\equal{#1}{}}{}{\textbf{Fixed:} #1 \\} \textbf{Given:} #3 \\ \textbf{Questions:} #4 \end{problem} } \newcommand{\qptime}[2]{$\langle$#1, #2$\rangle$} \newcommand{\qpoptimal}{\qptime{$O(n)$}{$O(1)$}} \newcommand{\constantdelaylin}{$\textsc{Constant-Delay}_{lin}$} \newcommand{\lineardelaylin}{$\textsc{Linear-Delay}_{lin}$} \newcommand{\definedterm}[1]{\emph{#1}} \newcommand{\leftsymbol}{\mathsf{left}} \newcommand{\rightsymbol}{\mathsf{right}} \newcommand{\data}[1]{\mathsf{#1}} \newcommand{\infixtable}{\data{in}} \newcommand{\posttable}{\data{post}} \newcommand{\prefixtable}{\data{pre}} \newcommand{\indextable}{\data{index}} \newcommand{\componenttable}{\data{component}} \newcommand{\breaktable}{\data{break}} \newcommand{\mathlca}{\mathit{LCA}}