Planning a party

4

34 votes
Problem

Difficulty level: Easy

Chef of salt and pepper restraunt is planning for a dinner party.He has decided to make certain dishes of n receipes.At a certain point of time, Chef has made some dishes of each receipe,given by the array where ith element shows the number of dishes already prepared of ith receipe . Chef wants to make equal number of dishes of all receipies. In an hour,chef can make 1 dish of all receipies except any one. That is he can make n-1 dishes of different receipes. Your task is to estimate how many hours will chef need to make equal number of dishes of all receipes.

Input:First line will give number of receipes n and second line will have n integers d1,d2,..,dn showing number of dishes prepared.

Output:Output in single line minimum hours needed to complete goal of chef.

Constraints: 1<=n<=10 0<=di<=25

Time Limit: 3
Memory Limit: 256
Source Limit:
Explanation

Initially, dishes: 4 5 6

at hour=1,dishes: 5 6 6 as chef will make dishes of all receipes except one.

at hour=2,dishes: 6 7 6 as chef will  make dishes of all receipes except one.

at hour=3,dishes: 7 7 7 . Goal achieved!
Editor Image

?