eolymp
bolt
Try our new interface for solving problems
Problems

Monk the Charles Greats

Monk the Charles Greats

Charles Greats was indeed the Great, as he thought about the future inhabitants of the country. In one of the first known school in Aachen, he was invited to teach math \textbf{795} monks Alkuina that his students suggested the following problem: "\textbf{100}\textit{ sheffels (monetary units) divided between men, women and children and made with men in }\textbf{3}\textit{ sheffels, with women in }\textbf{2}\textit{ sheffels and children of floor sheffels. How many men, women and children?}" General solution of linear Diophantine equations in those days did not know and were content with a few solutions that satisfy the problem. At the very Alkuina was given only one solution to this problem: men, women and children were \textbf{11}, \textbf{15} and \textbf{74}, and the problem actually has \textbf{784} solutions in natural numbers. We offer you to go further in the way of assimilation of Diophantine equations and solve a similar puzzle as follows: "\textit{\textbf{C}}\textit{ sheffels divided between men, women and children. Men were given }\textbf{A}\textit{ sheffels, women - the }\textbf{B}\textit{ sheffels, and children, as in ancient times, at half sheffels.}" How many solutions in positive integers has this problem? \InputFile In a single line given three positive integers: \textbf{A}, \textbf{B} and \textbf{C}. All input data does not exceed \textbf{1000}. \OutputFile Derive a single number - the answer of the problem.
Time limit 0.1 seconds
Memory limit 64 MiB
Input example #1
3 2 100
Output example #1
784