PROBLEM STATEMENT
The hotel industry is difficult to thrive in, especially when competing at a resort city like Las
Vegas.
Marketing is essential and often gets a large part of total revenues. You have a list of cities
you can market at,
and a good estimate of how many customers you will get for a certain amount of money spent at each
city.
You are given int[]s customers and cost. cost[i] is the amount of money required to get
customers[i] customers from the i-th city. You are only allowed to spend integer multiples of the
cost for any city. For example, if it costs 9 to get 3 customers from a certain city, you can
spend 9 to get 3 customer, 18 to get 6 customers, 27 to get 9 customers, but not 3 to get 1
customer, or 12 to get 4 customers. Each city has an unlimited number of potential customers.
Return the minimum amount of money required to get at least minCustomers customers.
DEFINITION
Class:Hotel
Method:marketCost
Parameters:int, vector , vector
Returns:int
Method signature:int marketCost(int minCustomers, vector customers, vector cost)
CONSTRAINTS
-minCustomers will be between 1 and 1000, inclusive.
-customers will contain between 1 and 20 elements, inclusive.
-cost will have the same number of elements as customers.
-Each element of cost and customers will be between 1 and 100, inclusive.
EXAMPLES
0)
10
{1,2,3}
{3,2,1}
Returns: 4
Just get 12 customers from the third city.
1)
10
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Returns: 10
It does not matter from which city you get your customers.
2)
12
{5, 1}
{3, 1}
Returns: 8
Get 10 customers from the first city, and 2 from the second city.
3)
100
{9, 11, 4, 7, 2, 8}
{4, 9, 3, 8, 1, 9}
Returns: 45
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.