#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 nn identical rectangles of width ww and height hh. The rectangles cannot be rotated. Their width-ww sides and height-hh 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 xx of a square that can contain all nn rectangles.

Input

The only line contains integers ww, hh, and nn.

Output

Print the minimum side length.

Subtasks

  • Subtask 1 — 20%: 1≤w,h,n≤1041\le w,h,n\le10^4.
  • Subtask 2 — 30%: 1≤w,h,n≤1071\le w,h,n\le10^7.
  • Subtask 3 — 50%: 1≤w,h,n≤1091\le w,h,n\le10^9.

Examples

Input

2 3 10

Output

9

Explanation

A side of 88 fits only 88 rectangles, while a side of 99 fits 1212, so the minimum is 99.