\usepackage{amsfonts,amsmath,amsthm,amssymb}
\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}	%[T1][TS1][OT1][OT2][T2A][T2B][T2C][X2]
\usepackage[cp1251]{inputenc}		%[utf8][cp1251][cp866]
\usepackage[a4paper,top=5cm,textwidth=127mm,lines=42,headheight=13pt,headsep=9pt,hcentering]{geometry}
%textwidth=127mm,lines=42;total={127mm,190mm}
\usepackage[english,russian]{babel}
\usepackage{babelbib}
\usepackage{textcase}
\usepackage{mathtools}
\usepackage{yhmath}
\usepackage{cmll}
\usepackage{xifthen}
\usepackage{calc}
\usepackage{cite}
\usepackage{url}
\usepackage{paralist}
\usepackage{fancyhdr}
\usepackage{ccaption}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{array}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{kbordermatrix}
\usepackage{algorithm}
\usepackage{algpseudocode}

%%%%%%% Установки для журнала %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcounter{year}\setcounter{year}{2019}		%год выпуска 
\newcounter{volume}\setcounter{volume}{26}		%номер тома
\newcounter{issue}\setcounter{issue}{2}			%номер журнала
\newcounter{allissue}\setcounter{allissue}{140}	%номер журнала от начала издания
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand\issueinfo[4]{%
	\setcounter{year}{#1}\setcounter{volume}{#2}%
	\setcounter{issue}{#3}\setcounter{allissue}{#4}%
}
\newcommand\issueinfoen[3]{\gdef\@yearen{#1}\gdef\@volumeen{#2}\gdef\@issueen{#3}}

\clubpenalty=10000
\widowpenalty=10000
% \newdimen\normalparindent
\normalparindent=15pt	%17pt
\parindent=\normalparindent
% \parskip=0pt plus 1pt
% \renewcommand\baselinestretch{1.05}

%% Настройки пакета paralist, отвечающего за вёрстку перечней
\pltopsep=1ex
\plitemsep=1ex

\newcounter{paper}\setcounter{paper}{0}
\newcounter{iterator}\setcounter{iterator}{0}
\@addtoreset{algorithm}{paper}
\@addtoreset{footnote}{paper}
\@addtoreset{figure}{paper}
\@addtoreset{table}{paper}
\@addtoreset{section}{paper}
\@addtoreset{equation}{paper}
\@addtoreset{theorem}{paper}
\@addtoreset{lemma}{paper}
\@addtoreset{claim}{paper}
\@addtoreset{corollary}{paper}
\@addtoreset{property}{paper}
\@addtoreset{conjecture}{paper}
\@addtoreset{problem}{paper}
\@addtoreset{definition}{paper}
\@addtoreset{remark}{paper}
\@addtoreset{example}{paper}

\def\months{\ifcase\theissue ********\or Январь--март\or Апрель--июнь\or Июль--сентябрь\or Октябрь--декабрь\else ********\fi}
\def\monthsen{\ifcase\theissue ********\or January--March\or April--June\or July--September\or October--December\else ********\fi}
\def\month#1{\ifcase#1 *****\or января\or февраля\or марта\or апреля\or мая\or июня%
							\or июля\or августа\or сентября\or октября\or ноября\or декабря\else *****\fi}
\def\monthen#1{\ifcase#1 *****\or January\or February\or March\or April\or May\or June%
							\or July\or August\or September\or October\or November\or December\else *****\fi}

\newcommand\setpaperlabel[1]{\gdef\paperlabel{#1}}
\let\paperlabel\@empty
\newcommand\setpaperoutline{%
	{\footnotesize\hfill\MakeUppercase{Дискретный анализ и исследование операций}\par}%
	{\scriptsize\hfill\months~\theyear. Т.~\thevolume, №~\theissue. С.~\pageref{\paperlabel1}--\pageref{\paperlabel2}\par}%
}
\newcommand\setpaperoutlineen{%
	{\footnotesize\hfill\MakeUppercase{Diskretnyi analiz i issledovanie operatsii}\par}%
	{\scriptsize\hfill\MakeUppercase{/Discrete Analysis and Operations Research/}\par}%
	{\scriptsize\hfill\monthsen~\theyear. Vol.~\thevolume, No.~\theissue. P.~\pageref{\paperlabel1}--\pageref{\paperlabel2}\par}%
}

\def\doiprefix{10.33048}
\def\doiprefixen{10.1134}
\def\translationjournal{Journal of Applied and Industrial Mathematics}
\newcommand\udc[1]{\gdef\@udc{УДК #1}\gdef\@udcen{UDC #1}}
\newcommand\doi[1]{\gdef\@doi{DOI \doiprefix/daio.\theyear.\thevolume.#1}}
\newcommand\setudcdoi{%
	\vspace{\baselineskip}%
	{\footnotesize\noindent\@udc\hfill\@doi\par}%
}
\newcommand\setudcdoien{%
	\vspace{\baselineskip}%
	{\footnotesize\noindent\@udcen\hfill\@doi\par}%
}
\newcommand\pagesen[2]{\gdef\@pagesen{#1--#2}}
\newcommand\doien[1]{\gdef\@doien{DOI \doiprefixen/#1}}

% \renewcommand*{\title}[2][]{\gdef\shorttitle{#1}\gdef\@title{#2}}
% \edef\title{\@nx\@dblarg
  % \@xp\@nx\csname\string\title\endcsname}
\newcommand*{\titleen}[2][]{\gdef\shorttitleen{#1}\gdef\@titleen{#2}}
\edef\titleen{\@nx\@dblarg
  \@xp\@nx\csname\string\titleen\endcsname}

\renewcommand\@settitle{%
	\vspace{\baselineskip}%
	{\noindent\centering\large\MakeUppercase\@title%
	\ifx\@empty\@thanks 
	\else
		\renewcommand\@makefnmark{}%
		\footnote{\@thanks\@addpunct.}%
		\setcounter{footnote}{0}
	\fi\par}%
}
\newcommand\@settitleen{%
	\vspace{\baselineskip}%
	{\noindent\centering\large\MakeTextUppercase\@titleen%
	\ifx\@empty\@thanksen 
	\else
		\renewcommand\@makefnmark{}%
		\footnote{\@thanksen\@addpunct.\vspace{.7\baselineskip}}%
		\setcounter{footnote}{0}
	\fi%
	\ifx\@empty\@issueen 
	\else
		\renewcommand\@makefnmark{}%
		\footnote{\hspace{-\parindent}\small English version: \translationjournal\ {\bfseries\@volumeen}~(\@issueen), \@pagesen\ (\@yearen), \@doien.}%
		\setcounter{footnote}{0}
	\fi\par
	}%
}

\renewcommand{\author}[2][]{%
  \ifx\@empty\authors
    \gdef\authors{#2}%
  \else
    \g@addto@macro\authors{{, }#2}%
  \fi
  \ifx\@empty\authorssup
    \gdef\authorssup{#2\@ifnotempty{#1}{\@textsuperscript{\normalfont\scriptsize\,#1}}}%
  \else
    \g@addto@macro\authorssup{{, }#2\@ifnotempty{#1}{\@textsuperscript{\normalfont\scriptsize\,#1}}}%
  \fi
}
\let\authorssup\@empty
\newcommand{\authoren}[2][]{%
  \ifx\@empty\authorsen
    \gdef\authorsen{#2}%
  \else
    \g@addto@macro\authorsen{\and#2}%
  \fi
  \ifx\@empty\authorssupen
    \gdef\authorssupen{#2\@ifnotempty{#1}{\@textsuperscript{\normalfont\scriptsize\,#1}}}%
  \else
    \g@addto@macro\authorssupen{\and#2\@ifnotempty{#1}{\@textsuperscript{\normalfont\scriptsize\,#1}}}%
  \fi
}
\let\authorsen\@empty	\let\authorssupen\@empty
\renewcommand\@setauthors{\par\vspace{\baselineskip}%
	{\noindent\centering\large\slshape\authorssup\par}%
}
\newcommand\@setauthorsen{\author@andify\authorssupen%
	\par\vspace{\baselineskip}%
	{\noindent\centering\large\slshape\authorssupen\par}%
}
\renewcommand\@@and{{\normalfont and}}
\renewcommand\author@andify{%
  \nxandlist {\unskip, }%
    {\unskip~\@@and~}%
    {\unskip,~\@@and~}%
}

\renewcommand\@setaddresses{%
	{\par\medskip%
	\def\address##1##2{\begingroup
		\noindent\centering\small
		\@ifnotempty{##1}{\ignorespaces\@textsuperscript{\scriptsize##1\,}\unskip}%
		##2\par\smallskip\endgroup}%
	\addresses
	}
}
\newcommand{\addressen}[2][]{\g@addto@macro\addressesen{\addressen{#1}{#2}}}
\newcommand\@setaddressesen{%
	{\par\medskip%
	\def\addressen##1##2{\begingroup
		\noindent\centering\small
		\@ifnotempty{##1}{\ignorespaces\@textsuperscript{\scriptsize##1\,}\unskip}%
		##2\par\smallskip\endgroup}%
	\addressesen
	}
}
\let\addressesen\@empty

\renewcommand{\email}[2][]{\g@addto@macro\emails{\email{#1}{#2}}\g@addto@macro\emailsen{\email{#1}{#2}}}
\newcommand\@setemails{\setcounter{iterator}{0}%
	{\par\small\centering%
	\noindent{\emailname:}%
	\def\email##1##2{\begingroup%
		\addtocounter{iterator}{1}%
		\if\arabic{iterator}1%
			\@ifnotempty{##1}{\@textsuperscript{\itshape\scriptsize##1\,}}%
			{\ttfamily##2}%
		\else
			{\ttfamily\unskip,}
			\@ifnotempty{##1}{\@textsuperscript{\itshape\scriptsize##1\,}}%
			{\ttfamily##2}
		\fi
		\endgroup}%
	\enspace\emails\par
	}
}
\newcommand\@setemailsen{\setcounter{iterator}{0}%
	{\par\small\centering%
	\noindent{\emailname:}%
	\def\email##1##2{\begingroup%
		\addtocounter{iterator}{1}%
		\if\arabic{iterator}1%
			\@ifnotempty{##1}{\@textsuperscript{\itshape\scriptsize##1\,}}%
			{\ttfamily##2}%
		\else
			{\ttfamily\unskip,}
			\@ifnotempty{##1}{\@textsuperscript{\itshape\scriptsize##1\,}}%
			{\ttfamily##2}%
		\fi
		\endgroup}%
	\enspace\emailsen\par
	}
}
\let\emails\@empty	\let\emailsen\@empty

\newcommand\settitle{%
	\@settitle%
	\@setauthors\@setaddresses%
	\@setemails\@setabstract%
}
\newcommand\settitleen{%
	\@settitleen%
	\@setauthorsen\@setaddressesen%
	\@setemailsen\@setabstracten%
}

\newcommand\fullname[1]{%
  \ifx\@empty\fullnames
    \gdef\fullnames{#1}%
  \else
    \g@addto@macro\fullnames{\par#1}%
  \fi
}
\newcommand\fullnameen[1]{%
  \ifx\@empty\fullnamesen
    \gdef\fullnamesen{#1}%
  \else
    \g@addto@macro\fullnamesen{\par#1}%
  \fi
}
\let\fullnames=\@empty	\let\fullnamesen=\@empty
\newcommand\@setfullnames{%
	\begin{minipage}[t]{.63\textwidth}%
		\small\slshape\fullnames%
	\end{minipage}%
}
\newcommand\@setfullnamesen{%
	\begin{minipage}[t]{.63\textwidth}%
		\small\slshape\fullnamesen%
	\end{minipage}%
}

\renewcommand\thanks[1]{\gdef\@thanks{#1}}
\newcommand\thanksen[1]{\gdef\@thanksen{#1}}
\let\@thanks=\@empty	\let\@thanksen=\@empty

\renewcommand{\abstractname}{Аннотация}
\newcommand{\abstractnameen}{Abstract}
\renewcommand{\keywordsname}{Ключевые слова}
\newcommand{\keywordsnameen}{Keywords}
\newcommand\emailname{E-mail}
\renewcommand\abstract[1]{\def\@abstract{#1}}
\newcommand\abstracten[1]{\def\@abstracten{#1}}
\let\@abstract=\@empty	\let\@abstracten=\@empty
\newcommand\keywordsen[1]{\def\@keywordsen{#1}}
\let\@keywordsen=\@empty

\newdimen\abstractmargin
\abstractmargin=27pt
\renewcommand\@setabstract{%
	\par\vspace{\baselineskip}%
	\begin{list}{}{\small\leftmargin=\abstractmargin%
					\rightmargin=\leftmargin \labelwidth\z@%
					\listparindent=\normalparindent \itemindent\z@%
				  }
		\item[\hskip\labelsep\bfseries\abstractname.] \@abstract\@addpunct.\par
		\medskip
		\item[\hskip\labelsep\bfseries\keywordsname:] \@keywords\@addpunct.\par
	\end{list}
}
\newcommand\@setabstracten{%
	\par\vspace{\baselineskip}%
	\begin{list}{}{\small\leftmargin=\abstractmargin%
					\rightmargin=\leftmargin \labelwidth\z@%
					\listparindent=\normalparindent \itemindent\z@%
				  }
		\item[\hskip\labelsep\bfseries\abstractnameen.] \@abstracten\@addpunct.\par
		\medskip
		\item[\hskip\labelsep\bfseries\keywordsnameen:] \@keywordsen\@addpunct.\par
	\end{list}
}
\renewcommand\@setkeywords{{\bfseries \keywordsname:}\enspace \@keywords\@addpunct.}
\newcommand\@setkeywordsen{{\bfseries \keywordsnameen:}\enspace \@keywordsen\@addpunct.}

\newcommand\setpaper{\@settitle\@setauthors\@setemails\@setabstract}
\newcommand\setpaperen{\@settitleen\@setauthorsen\@setemails\@setabstracten}

\newcommand\paperdates[9]{%
	\def\@received{#1~\month{#2}~#3~г.}%
	\def\@revised{#4~\month{#5}~#6~г.}%
	\def\@accepted{#7~\month{#8}~#9~г.}%
	\def\@receiveden{\monthen{#2}~#1,~#3}%
	\def\@reviseden{\monthen{#5}~#4,~#6}%
	\def\@accepteden{\monthen{#8}~#7,~#9}%
}
\newcommand\@setpaperdates{%
	\begin{minipage}[t]{.37\textwidth}%
		\small\raggedright%
		Статья поступила \@received\par
		\smallskip
		После доработки\,--- \@revised\par
		\smallskip
		Принята к публикации \@accepted
	\end{minipage}%
}
\newcommand\@setpaperdatesen{%
	\begin{minipage}[t]{.37\textwidth}%
		\small\raggedright%
		Received \@receiveden\par
		\smallskip
		Revised \@reviseden\par
		\smallskip
		Accepted \@accepteden
	\end{minipage}%
}

\renewcommand\enddoc@text{}
\newcommand\setpaperend{%
	\vspace{\baselineskip}%
	\noindent\@setfullnames\@setpaperdates%
}
\newcommand\setpaperenden{%
	\vspace{\baselineskip}%
	\noindent\@setfullnamesen\hfill\@setpaperdatesen%
}

\def\@clearpaperattributes{%
	\def\do##1{\let##1\@empty}%
	\do\@title \do\@thanks \do\@doi 
	\do\authorssup \do\addresses \do\emails
	\do\@abstract \do\@keywords
	\do\shorttitle \do\authors \do\fullnames
	\do\paperlabel
}
\def\@clearpaperattributesen{%
	\def\do##1{\let##1\@empty}%
	\do\@titleen \do\@thanksen \do\@pagesen \do\@doien 
	\do\authorssupen \do\addressesen \do\emailsen
	\do\@abstracten \do\@keywordsen
	\do\shorttitleen \do\authorsen \do\fullnamesen
}
\def\newpaper{\newpage%
	\@clearpaperattributes%
	\@clearpaperattributesen%
	\refstepcounter{paper}%
}

\newtheoremstyle{slanted}{}{}{\slshape}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}{}
\newtheoremstyle{cited}{}{}{\slshape}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}%
{\thmname{#1}\thmnumber{ #2}{\normalfont\rmfamily\thmnote{ #3}}}
\newtheoremstyle{abbreviated}{}{}{\slshape}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}%
{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}}
\newtheoremstyle{named}{}{}{\slshape}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}%
{\thmname{#1}\thmnumber{ #2}\thmnote{ #3}}
\newtheoremstyle{heading}{}{}{\slshape}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}%
{\thmnote{#3}}
\newtheoremstyle{plainindented}{}{}{\normalfont}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}{}
\newtheoremstyle{plaincited}{}{}{\normalfont}{\parindent}{\bfseries}{.}{5pt plus 1pt minus 1pt}%
{\thmname{#1}\thmnumber{ #2}{\normalfont\rmfamily\thmnote{ #3}}}

\theoremstyle{slanted}
\newtheorem{theorem}{Теорема}
\newtheorem{lemma}{Лемма}
\newtheorem{claim}{Утверждение}
\newtheorem{corollary}{Следствие}
\newtheorem{property}{Свойство}
\newtheorem{conjecture}{Гипотеза}
\newtheorem{problem}{Задача}

\theoremstyle{cited}
\newtheorem{ctheorem}[theorem]{Теорема}
\newtheorem{clemma}[lemma]{Лемма}
\newtheorem{cclaim}[claim]{Утверждение}
\newtheorem{ccorollary}[corollary]{Следствие}
\newtheorem{cproperty}[property]{Свойство}
\newtheorem{cconjecture}[conjecture]{Гипотеза}
\newtheorem{cproblem}[problem]{Задача}

\theoremstyle{abbreviated}
\newtheorem*{abtheorem}{Theorem}
\newtheorem*{ablemma}{Lemma}
\newtheorem*{abproblem}{Problem}

\theoremstyle{named}
\newtheorem*{ntheorem}{Теорема}
\newtheorem*{nlemma}{Лемма}
\newtheorem*{nproblem}{Задача}

\theoremstyle{heading}
\newtheorem*{anyheading}{}

\theoremstyle{plainindented}
\newtheorem{definition}{Определение}
\newtheorem{remark}{Замечание}
\newtheorem*{remarknotag}{Замечание}
\newtheorem*{remarks}{Замечания}
\newtheorem{example}{Пример}
\newtheorem*{examples}{Примеры}

\theoremstyle{plaincited}
\newtheorem{cdefinition}[definition]{Определение}
\newtheorem{cexample}[example]{Пример}

\renewcommand\qedsymbol{}
\renewenvironment{proof}[1][\proofname\@addpunct.]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \scshape
    \hspace{\parindent}#1]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\newcommand\thmp{Теорема~\thetheorem{} доказана.}
\newcommand\lemp{Лемма~\thelemma{} доказана.}
\newcommand\clmp{Утверждение~\theclaim{} доказано.}
\newcommand\corp{Следствие~\thecorollary{} доказано.}
\newcommand\prpp{Свойство~\theproperty{} доказано.}
\newdimen\afterproofskipamount
\setlength\afterproofskipamount{5pt plus 1pt minus 1pt}
\newcommand\afterproofskip{\vspace\afterproofskipamount}

\setcounter{secnumdepth}{2}
\renewcommand\@secnumfont{\bfseries}
\renewcommand\section{\@startsection{section}{1}%
  \z@{.7\baselineskip\@plus.5\baselineskip}{.5\baselineskip}%
  {\normalfont\bfseries\centering}}
\renewcommand\subsection{\@startsection{subsection}{2}%
  \parindent{.5\baselineskip\@plus.3\baselineskip}{-.5em}%
  {\normalfont\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}%
  \parindent{.5\baselineskip\@plus.1\baselineskip}{-\fontdimen2\font}%
  {\normalfont\scshape}}
\def\@seccntformat#1{\csname the#1\endcsname. }

\captiondelim{. }
\newcommand{\tcaption}[2][\@empty]{%
\captionnamefont{\small\itshape\hfill}
\captiondelim{}
\ifthenelse{\equal{#2}{}}{}{%
	\captionstyle{\\[5pt]\centering}%
	\captiontitlefont{\bfseries\small}}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{6pt plus 3pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}
\newcommand{\tcaptionempty}[2][\@empty]{%
\captionnamefont{\small\itshape\hfill}
\captiondelim{}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{6pt plus 3pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}
\newcommand{\@outtcaption}[2][\@empty]{%
\captionnamefont{\small\itshape\hfill}
\captiondelim{}
\ifthenelse{\equal{#2}{}}{%
	\setlength{\abovecaptionskip}{0pt}}{%
	\captionstyle{\\[5pt]\centering}%
	\captiontitlefont{\bfseries\small}%
	\setlength{\abovecaptionskip}{.7\baselineskip\@plus.5\baselineskip}}
\setlength{\belowcaptionskip}{0pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}
\newcommand{\@outtcaptionempty}[2][\@empty]{%
\captionnamefont{\small\itshape\hfill}
\captiondelim{}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{0pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}
\newfixedcaption[\@outtcaption]{\outtcaption}{table}
\newfixedcaption[\@outtcaptionempty]{\outtcaptionempty}{table}

\newcommand{\fcaption}[2][\@empty]{%
\captionnamefont{\small\itshape}
\ifthenelse{\equal{#2}{}}{\captiondelim{}}{\captiondelim{. }}
\captionstyle{\centering}
\captiontitlefont{\small}
\setlength{\abovecaptionskip}{9pt}
\setlength{\belowcaptionskip}{0pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}
\newcommand{\fcaptionempty}[2][\@empty]{%
\captionnamefont{\small\itshape}
\captiondelim{}
\captionstyle{\centering}
\captiontitlefont{\small}
\setlength{\abovecaptionskip}{9pt}
\setlength{\belowcaptionskip}{0pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}

\newcommand{\acaption}[2][\@empty]{%
\captionnamefont{\bfshape}
\ifthenelse{\equal{#2}{}}{\captiondelim{}}{\captiondelim{. }}
\captionstyle{}
\captiontitlefont{}
\setlength{\abovecaptionskip}{0pt}
\setlength{\belowcaptionskip}{0pt}
\ifx\@empty#1 \caption{#2}\else \caption[#1]{#2}\fi
}

\addto\extrasrussian{%
\def\refname{{\normalfont\bfseries\MakeUppercase{Литература}}}
}
\addto\extrasenglish{%
\def\refname{{\normalfont\bfseries\MakeUppercase{References}}}
}
\renewcommand*\@biblabel[1]{\hfill\normalfont\bfseries#1.}
\renewcommand{\bibliofont}{\small}

\renewcommand\footnoterule{\kern-0.4\p@
		\hrule\@width .3\textwidth\kern11\p@\kern-\footnotesep}
\renewcommand\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark)}}}

\newcommand\firstpagegeometry{%
\newgeometry{top=5cm,total={127mm,190mm},hcentering,footskip=1.5\baselineskip,includefoot}
}

\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[L]{\small\copyright\ \authors, \arabic{year}}
\addtolength{\footskip}{.7\baselineskip}
\renewcommand{\headrulewidth}{0pt}
}

\pagestyle{fancy}
\newcommand\paperhead{%
\fancyhf{}
\fancyhead[EL,OR]{\normalfont\rmfamily\thepage}
\fancyhead[EC]{\normalfont\slshape\fontencoding{T2A}\selectfont\authors}
\fancyhead[OC]{\normalfont\slshape\fontencoding{T2A}\selectfont\shorttitle}
}
\newcommand\paperheaden{%
\fancyhf{}
\fancyhead[EL,OR]{\normalfont\rmfamily\thepage}
\fancyhead[EC]{\normalfont\slshape\author@andify\authorsen\authorsen}
\fancyhead[OC]{\normalfont\slshape\shorttitleen}
}

\newlength{\titlewidth}
\newlength{\pagewidth}
\newlength{\hangindentskip}
\setlength{\titlewidth}{\textwidth}
\setlength{\pagewidth}{24pt}
\setlength{\hangindentskip}{21pt}
\addtolength{\titlewidth}{-\pagewidth}
\newcommand{\contline}[3]{%
\small\bigskip
\parbox[b]{\titlewidth}{%
\raggedright\hangindent=\hangindentskip
{\bfseries #1} {\slshape #2}\dotfill}%
\hbox to \pagewidth{\hfill\bfseries#3}\par
}

\floatname{algorithm}{Алгоритм}
\def\f@numalgorithm{\fname@algorithm \thealgorithm. }
\renewcommand\algorithmicrequire{\textbf{Вход:}}
\renewcommand\algorithmicensure{\textbf{Выход:}}

\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}

\def\No{№}
\def\emptyset{\varnothing}
\def\leq{\leqslant}
\def\geq{\geqslant}
\def\le{\leqslant}
\def\ge{\geqslant}
\def\ord{\mathop{\mathrm{ord}}}
