\documentclass{article}
\usepackage[cp1251]{inputenc}
\usepackage[russian]{babel}
\usepackage[dvips,a4paper,margin=3cm]{geometry} 
%\usepackage[T2A]{fontenc}                                %This should be compiled with pdflatex
%\usepackage[unicode,a4paper,pdftex,colorlinks]{hyperref} %This should be compiled with pdflatex
\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{amsthm}
\theoremstyle{plain}
\newtheorem{theorem}{Теорема}
\newtheorem{proposition}{Утверждение}
\newtheorem{lemma}{Лемма}
\newtheorem{corollary}{Следствие}
\newtheorem{property}{Свойство}
\theoremstyle{remark}
\newtheorem{definition}{Определение}
\newtheorem{note}{Замечание}
\newtheorem{example}{Пример}
\newtheorem{exercize}{Упражнение}

\usepackage[noend]{algorithmic}
\def\algorithmicrequire{\textbf{Вход:}}
\def\algorithmicensure{\textbf{Выход:}}
\def\algorithmiccomment#1{\quad// {\sl #1}}

\usepackage[bf,small,raggedright,indentafter]{titlesec} 
\titlelabel{\thetitle. } 

\usepackage{tocloft}
\renewcommand{\cftsecaftersnum}{.}
\renewcommand{\cftsubsecaftersnum}{.}

\usepackage[format=hang,labelsep=period,font={small},labelfont={it}]{caption}

\newcommand{\lectitle}[2]{\title{Лекция \No\,#1 \\ #2}}
\newcommand{\lecauthor}[1]{\author{Лектор: Н.Ю.\,Золотых \hspace{0.2\textwidth} Записал: #1}}

\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\Ref}[1]{{\rm(\ref{#1})}}
\newcommand{\GCD}{\mathop{\mbox{\rm НОД}}}
\newcommand{\divv}{\mathop{\,\mbox{\raisebox{-.45ex}[0pt]{$\vdots$}}\,}}

\newenvironment{narrowarray}[1]{\arraycolsep=0.15em\begin{array}{#1}}{\end{array}}
