\NeedsTeXFormat{LaTeX2e}

\usepackage[T1]{fontenc}
\usepackage{titletoc}%
\usepackage{titlesec}%
\usepackage[top=1.5in, bottom=1in, left=1.25in, right=1.25in]{geometry}%
\usepackage{amsfonts,amsmath,amssymb,mathrsfs}%math packages
\usepackage[unicode]{hyperref}%
%\usepackage[lined,linesnumbered]{algorithm2e}%
\usepackage{newalg}%since we want to use the design of CLR
\usepackage{fancyhdr}%
%\usepackage{slantsc}%
\usepackage{subfig,subfloat}%
\usepackage{pgf,tikz}%


\def\@homeworkauthor{Use sethwauthor\{author\} to set your name}
\def\@homeworktitle{Use sethwtitle\{title\} to set the title}
\def\sethwtitle#1{
\def\@homeworktitle{#1}}%
\def\sethwauthor#1{
\def\@homeworkauthor{#1}}%
\def\makehwheader{
\pagestyle{fancy}
\lhead{\bfseries{\@homeworktitle}}%
\rhead{\textit{By \@homeworkauthor}}%
\chead{}%
\lfoot{}%
\cfoot{\thepage}%
\rfoot{}}%

\titleformat{\section}%
    [hang]%
    {\normalfont\large\bfseries%
     }%
    {Problem \thesection
     }%
    {1em}%
    {}
    [
    \hrulefill{\phantom{mmmmmm}}
    \vskip 6pt]
\titlespacing{\section}%
    {0bp}{24bp}{6bp}

\titleformat{\subsection}%
    [hang]%
    {\normalfont\normalsize\bfseries%
     }%
    {(\@arabic\c@subsection)}%
    {1em}%
    {}%
    {}%
\titlespacing{\subsection}%
    {0bp}{16bp}{6bp}

\def\tab{\noindent \leftskip=30bp}
%the following command works with package newalg.
\def\comment#1{
\rhd $#1$\\ }

\def\makehwtitle{
\begin{center}
\textbf{ \large{\@homeworktitle}}\\%
\@homeworkauthor\\
\today
\end{center}
%put other desirable format here
\parindent=0em
%%algorithm2e settings
%\linesnumberedhidden%
%\dontprintsemicolon%
%%newalg settings

}
\endinput
