Company: Barclays
Difficulty: medium
\n \n Project Work Weeks \n \n An employee in an organization has begun working on N projects (numbered 0 to N-1). Each week he/she can work on a single module of one of the projects. The modules are chosen by the employee based on the number of modules from different projects. A project can have at most C modules. The modules of the projects are such that it can be completed in a week.\n \n \n Write an algorithm to determine the number of weeks the employee can work on projects following the above-mentioned rules.\n \n \n \n \n Input Format \n \n The first line of the input consists of an integer num , representing the number of projects (N). The next line consists of N space-separated integers: projC 0 , projC 1 , ..., projC N-1 , representing the number of modules of the projects.\n \n \n \n \n Output Format \n \n Print an integer representing the maximum number of weeks the employee can work on the projects.\n \n \n \n \n Constraints \n \n 1 ≤ num ≤ 10 4 \n 1 ≤ projC i ≤ 10 7 \n Σ