RHHS is a very popular school and has a very large number of students. However, this year there are too many students and not enough rooms for all of them. You have been tasked with building a new school building to accommodate classrooms.
The new school can have an unlimited number of floors, provided that there are no gaps in the building. Each floor can have an unlimited number of rooms. The cost of building the classroom on the floor is . What is the minimum cost to build the new school?
Constraints
For all subtasks:
Points Awarded | |
---|---|
6 points | |
9 points |
Input Specification
The first and only line contains three integers , , and .
Output Specification
Output the minimum cost required to build the new school. Please note that this number may not fit inside a 32-bit integer.
Sample Input
5 5 7
Sample Output
94
Comments