eolymp
bolt
Try our new interface for solving problems
Problems

Lilavati

Lilavati

\includegraphics{https://static.e-olymp.com/content/3b/3b866748f8e7bb92a0b8fdbcf6227d3ccc61c923.jpg} India's largest mathematics XII century. Bhaskara belongs to the treatise "Siddhanta-Shiromani" ("Teachings of the crown"), rewritten in the XIII century. on strips of palm leaves. This treatise consists of four parts, of which "Lilavati" is devoted to arithmetic, "Bidzhaganita" - algebra, the other two parts of astronomy. "Lilavati" (which means "beautiful") Bhaskara devoted to his daughter. Many of their puzzles Bhaskara expounded in poetic form, here's one: \textit{From the set of pure lotus The third part has been brought in gift Shiva The fifth part - Vishnu, the sixth - the Sun; The fourth part of all flowers received Bhvani,} \textit{ The remaining six flowers were given to highly esteemed Teacher.} We can not literally convey the charm and beauty of the sound of these poems of ancient India, so our puzzle formulated in prose. So this is a little problem in general terms: "\textit{The gift of Lord Shiva brought }\textit{\textbf{A}}\textit{-th part of lotus flowers, a gift of Lord Vishnu - }\textit{\textbf{B}}\textit{-th part of the gift the Sun - }\textit{\textbf{C}}\textit{-th part, for Bhvani got }\textit{\textbf{D}}\textit{-nd of the highly esteemed Teacher and received }\textit{\textbf{E}}\textit{ flowers. How many lotus flowers were available to those who gave?}" \InputFile In the first and only line of the input data set through the gap \textbf{5} of integers: \textbf{A}, \textbf{B}, \textbf{C}, \textbf{D} and \textbf{E}, each of which does not exceed \textbf{100}. \OutputFile Derive a single number - the answer to the problem, or \textbf{-1} if the input data are inconsistent, or they solve puzzle certainly not given the opportunity.
Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
3 5 6 4 6
Output example #1
120
Author Анатолий Присяжнюк
Source Open and Distance Olympiads 2011-2012