eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Box of Bricks

Box of Bricks

\includegraphics{https://static.e-olymp.com/content/fb/fbeea93e3ef2170e6990571a5555e4be4d2a11cc.jpg} Pasha assembled box of bricks in the form of a rectangular parallelepiped and thought over the question: what is a minimal number of bricks lay on the route between two opposite corners of the parallelepiped, if it is allowed to pass from brick to other brick through the common face, edge or vertex? In the figure opposite bricks are highlighted. Help Pasha to write a program that calculates minimal number of bricks on the route. \InputFile Integer \textbf{n}, \textbf{m}, \textbf{k} (\textbf{1} ≤ \textbf{n}, \textbf{m}, \textbf{k} ≤ \textbf{1000}) -- the size of rectangular parallelepiped (in bricks). \OutputFile Integer -- the minimal number of bricks.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
3 3 3
Вихідні дані #1
3
Джерело 2013-2014 ACM Central Region of Russia Quarterfinal, Rybinsk 2013/10/17