Jzzhu has a big rectangular chocolate bar that consists of n × m unit squares. He wants to cut this bar exactly k times. Each cut must meet the following requirements:

  * each cut should be straight (horizontal or vertical); 
  * each cut should go along edges of unit squares (it is prohibited to divide any unit chocolate square with cut); 
  * each cut should go inside the whole chocolate bar, and all cuts must be distinct. 



The picture below shows a possible way to cut a 5 × 6 chocolate for 5 times.

<image>

Imagine Jzzhu have made k cuts and the big chocolate is splitted into several pieces. Consider the smallest (by area) piece of the chocolate, Jzzhu wants this piece to be as large as possible. What is the maximum possible area of smallest piece he can get with exactly k cuts? The area of a chocolate piece is the number of unit squares in it.

Input

A single line contains three integers n, m, k (1 ≤ n, m ≤ 109; 1 ≤ k ≤ 2·109).

Output

Output a single integer representing the answer. If it is impossible to cut the big chocolate k times, print -1.

Examples

Input

3 4 1


Output

6


Input

6 4 2


Output

8


Input

2 3 4


Output

-1

Note

In the first sample, Jzzhu can cut the chocolate following the picture below:

<image>

In the second sample the optimal division looks like this:

<image>

In the third sample, it's impossible to cut a 2 × 3 chocolate 4 times.

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 *
 *
 * 10 5 8 1 10 3 6 2 9 7 4 4 2 6 3 1 9 10 5 8 7
 *
 * @author pttrung
 */
public class C {

    //   public static long x, y, gcd;
    public static int Mod = 1000000007;
    public static PrintWriter out;
    public static long[][] dp;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        out = new PrintWriter(System.out);
        //   System.out.println(Integer.MAX_VALUE);
        //PrintWriter out = new PrintWriter(new FileOutputStream(new File("output.txt")));
        long n = in.nextInt();
        long m = in.nextInt();
        long k = in.nextInt();
        if ((n - 1) + (m - 1) >= k) {
            
           
            long re = Math.max(f(Math.min(k,n - 1 ),k,n,m), f(Math.max(0, k - (n - 1)),k,n,m));
            re = Math.max(f(Math.min(k, m -1), k,m,n) , re);
            re = Math.max(f(Math.max(0,k - (m -1)), k,m,n) , re);
            out.println(re);

        } else {
            out.println(-1);
        }
        out.close();
    }

    public static long f(long a, long k, long n, long m) {
        if (a >= 0 && (k - a + 1) > 0) {
            long val = (n / (a + 1)) * (m / (k - a + 1));
            //System.out.println(val + " " + a + " " + (n/(a + 1)) + " " + m/(k - a + 1) );
            return val;
        }
        return 0;
    }

    public static long cal(int s, int e, long[] data) {
        // System.out.println(s + " " + e);
        if (dp[s][e] != 0) {
            return dp[s][e];
        }
        long result = e - s + 1;
        int index = s;
        for (int i = s; i <= e; i++) {
            if (data[i] < data[index]) {
                index = i;
            }
        }
        long other = 0;

        if (s > 0) {
            other = data[s - 1];
        }
        if (e + 1 < data.length) {
            other = Math.max(data[e + 1], other);
        }

        long val = data[index] - other;
        int start = -1;
        for (int i = s; i <= e; i++) {
            if (data[i] > data[index]) {
                if (start == -1) {
                    start = i;
                }
            } else if (data[i] <= data[index]) {
                if (start != -1) {
                    long a = cal(start, i - 1, data);
                    val += a;
                    start = -1;
                }
            }
        }
        if (start != -1) {
            val += cal(start, e, data);
        }

        //System.out.println(Math.min(result, val) + " " +s  + " " + e);
        return dp[s][e] = Math.min(result, val);
    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static long pow(long a, long b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {
            return val * val;
        } else {
            return val * val * a;
        }
    }

    public static int gcd(int a, int b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);


    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Point o) {
            if (x != o.x) {
                return x - o.x;
            } else {
                return y - o.y;
            }
        }
    }
//    public static void extendEuclid(long a, long b) {
//        if (b == 0) {
//            x = 1;
//            y = 0;
//            gcd = a;
//            return;
//        }
//        extendEuclid(b, a % b);
//        long x1 = y;
//        long y1 = x - (a / b) * y;
//        x = x1;
//        y = y1;
//
//    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}
