The City of Trollampur
All submissions for this problem are available.
You are the architect of City Trollampur. Trollampur has N buildings, ith building has a height of B[i] bricks.
You have some X bricks leftover with you. You want to put those X bricks on some of the buildings.Attractiveness of the city is defined as the Height of the lowest
building in the city.You can put X bricks on some of the towers and hence increase the attractiveness of the city.You CAN only INCREASE the height of the building by
adding bricks.You have to maximize the attractiveness of the city.
First Line: Integer T, denoting number of test cases.
For each test case we have 2 lines :
First Line includes 2 integers N and X, namely number of Buildings and
number of Bricks you have.
Second Line : N integers, ith integer denoting height of ith building.
- For each test case,
Print one integer, the maximum attractiveness of the city, you can achieve.
- 1 ≤ T ≤ 10
- 1 ≤ N ≤ 100000
- 0 ≤ B[i] ≤ 10^8
- 0 ≤ X ≤ 10^8
1 2 5 4 3
4 4 4 4 4
Test Case 1 :
Adding 2 bricks to Building with Height 1 and 2 bricks to Building with
Height 2 will make the city as 3 4 5 4 3 .
Minimum Height among these Buildings is 3.
Test Case 2 :
Adding 1 brick to every Building will make the city as : 5 5 5 5 5
Minimum Height among these buildings is 5.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.