#BS0000019. Đóng gói hình chữ nhật (Packing Rectangles)
Đóng gói hình chữ nhật (Packing Rectangles)
Packing Rectangles
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
There are identical rectangles of width and height . The rectangles cannot be rotated. Their width- sides and height- sides keep their original orientation, their sides are parallel to the sides of the containing square, and rectangles may not overlap. Find the minimum integer side length of a square that can contain all rectangles.
Input
The only line contains integers , , and .
Output
Print the minimum side length.
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: .
Examples
Input
2 3 10
Output
9
Explanation
A side of fits only rectangles, while a side of fits , so the minimum is .