1007: Number of donuts
[Creator : ]
Description
There are N teams and each team has Ti People; in order to encourage the hard work of each team member, we decide to distribute a donuts to them. There are four requirements:
A) The cost of each donut is C dollars; there is a budget limit and the total amount of money spent should not be over B dollars;
B) Each group should have the same number of donuts.
C) To be fair, each member in the same group should have the same number of donuts. And all the donuts should be distributed to the team member. (donut can not be cut into pieces )
D) Try to distribute as many as possible donuts to each team.
Please find out how many donuts for each team.
A) The cost of each donut is C dollars; there is a budget limit and the total amount of money spent should not be over B dollars;
B) Each group should have the same number of donuts.
C) To be fair, each member in the same group should have the same number of donuts. And all the donuts should be distributed to the team member. (donut can not be cut into pieces )
D) Try to distribute as many as possible donuts to each team.
Please find out how many donuts for each team.
Input
The first line contains three integers N, C and B
The second line contains N integers Ti which are number of members for team i.
( 1<= N <= 100, 1<= C <= 10, 1<= B <= 1000000 , 1 <= Ti <= 1000)
It is guaranteed each people has at least one donuts
The second line contains N integers Ti which are number of members for team i.
( 1<= N <= 100, 1<= C <= 10, 1<= B <= 1000000 , 1 <= Ti <= 1000)
It is guaranteed each people has at least one donuts
Output
One integer which is the number of donuts for each team
Sample Input Copy
3 2 700
2 4 5
Sample Output Copy
100
HINT
In the example, each team has 100 donuts and in total, it costs 600 which is less than 700; and this is the maximum donuts for each team.