One day n friends gathered together to play "Mafia". During each round of the game some player must be the supervisor and other n - 1 people take part in the game. For each person we know in how many rounds he wants to be a player, not the supervisor: the i-th person wants to play ai rounds. What is the minimum number of rounds of the "Mafia" game they need to play to let each person play at least as many rounds as they want?

Input

The first line contains integer n (3 ≤ n ≤ 105). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the i-th number in the list is the number of rounds the i-th person wants to play.

Output

In a single line print a single integer — the minimum number of game rounds the friends need to let the i-th person play at least ai rounds.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Examples

Input

3
3 2 2


Output

4


Input

4
2 2 2 2


Output

3

Note

You don't need to know the rules of "Mafia" to solve this problem. If you're curious, it's a game Russia got from the Soviet times: http://en.wikipedia.org/wiki/Mafia_(party_game).
//package com.company;

import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static int maxOf3(int x, int y, int z) {
        return Math.max(x, Math.max(y, z));
    }

    public static int minof3(int x, int y, int z) {
        return Math.min(x, Math.min(y, z));
    }

    public static long maxOf3(long x, long y, long z) {
        return Math.max(x, Math.max(y, z));
    }

    public static long minof3(long x, long y, long z) {
        return Math.min(x, Math.min(y, z));
    }

    public static void arrInput(int[] arr, int n) {
        for (int i = 0; i < n; i++)
            arr[i] = sc.nextInt();
    }

    public static void arrInput(long[] arr, int n) {
        for (int i = 0; i < n; i++)
            arr[i] = sc.nextLong();
    }

    public static int maxarrInput(int[] arr, int n) {
        int max = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
            max = Math.max(max, arr[i]);
        }
        return max;

    }

    public static long maxarrInput(long[] arr, int n) {
        long max = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextLong();
            max = Math.max(max, arr[i]);
        }
        return max;
    }

    public static int minarrInput(int[] arr, int n) {
        int min = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
            min = Math.max(min, arr[i]);
        }
        return min;
    }

    public static long minarrInput(long[] arr, int n) {
        long min = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextLong();
            min = Math.max(min, arr[i]);
        }
        return min;
    }

    public static long sumofarr(int[] arr) {
        long sum = 0;
        for (int i : arr)
            sum += i;
        return sum;
    }

    public static long sumofarr(long[] arr) {
        long sum = 0;
        for (long i : arr)
            sum += i;
        return sum;
    }

    public static int lowerBound(int[] arr, int x) {
        int l = -1, r = arr.length;
        while (l + 1 < r) {
            int m = (l + r) >>> 1;
            if (arr[m] >= x) r = m;
            else l = m;
        }
        return r;
    }

    public static int upperBound(int[] arr, int x) {
        int l = -1, r = arr.length;
        while (l + 1 < r) {
            int m = (l + r) >>> 1;
            if (arr[m] <= x) l = m;
            else r = m;
        }
        return l + 1;
    }

    public static long maxofarr(long[] arr) {
        long max = 0;
        for (long i : arr)
            max = Math.max(i, max);
        return max;
    }

    public static long minofarr(long[] arr) {
        long min = Integer.MAX_VALUE;
        for (long i : arr)
            min = Math.min(min, i);
        return min;
    }

    public static int maxofarr(int[] arr) {
        int max = 0;
        for (int i : arr)
            max = Math.max(i, max);
        return max;
    }

    public static int minofarr(int[] arr) {
        int min = Integer.MAX_VALUE;
        for (int i : arr)
            min = Math.min(min, i);
        return min;
    }

    public static long mod = (long) (1e9 + 7);
    public static FastReader sc = new FastReader();
    public static PrintWriter out = new PrintWriter(System.out);

    //******************************--SOLUTION--******************************


    public static void main(String[] args) {
        int n = sc.nextInt();
        int temp=n;
        long max = 0, x, count = 0;
        while (n-- > 0) {
            x = sc.nextLong();
            max = Math.max(max, x);
            count += x;
        }
        n=temp-1;
        count= (long) Math.max(max,Math.ceil((double) count/(n)));
        out.println(count);

        out.flush();
    }
}

//******************************************************
class Node {
    int val;
    Node next;

    Node() {
    }

    Node(int val) {
        this.val = val;
    }

    Node(int val, Node next) {
        this.val = val;
        this.next = next;
    }
}

class Pair {
    int first, second;

    Pair(int x, int y) {
        this.first = x;
        this.second = y;
    }
}

class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                System.out.println(e);
            }
        }
        return st.nextToken();
    }

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

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

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

    public String nextLing() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            System.out.println(e);
        }
        return str;
    }
}