This is fixed project. my budget is 5 usd.
Hurdle Race
Problem Description
You are participating in an interesting hurdle race. The race comprises of stairs of certain heights and points at every meter that can be collected. Initially, you are at height 0. In order to make race interesting, an additional constraint is imposed in the race. You are given with certain indexes along with a minimum height you must be at when you reach that index. You are allowed to move forward if and only if you are at a minimum height specified at that index. Your task is to reach the end with the maximum amount of points.
You are given with 2 arrays, points and height of size n each. Array points denote the points at n meters. Array height denotes the height of stairs at n meters. You are given with 2 more arrays, index and minheight of size m each. Array index denotes the index at which you must have a specific height to proceed ahead. Array minheight denote the minimum height that must be there to proceed ahead. At every index i, you can either pick the point[i] or climb the stairs and increase the height by height[i]. Your task is to tell the maximum points that can be collected when we reach the end. Output -1 if we can not reach the end of the race.
INPUT FORMAT:
The first line of input contains a single integer T denoting the number of test cases.
The first line of each test case contains a single integer n.
Next line contains n space-separated integers denoting points[i].
Next line contains n space-separated integers denoting height[i].
Next line contains a single integer m.
Next line contains m space-separated integers denoting index[i].
Next line contains m space-separated integers denoting minheight[i].
OUTPUT FORMAT:
Output a single integer denoting the maximum points that can be collected when we reach the end.
CONSTRAINTS:
1 <= T <= 10
1 <= M <= N <= 1000
1 <= points[i] <= 10^5
1 <= height[i] <= 10^4
1 <= index[i] <= N-1
1 <= minheight[i] <= 10^4
SAMPLE INPUT #1:
1
4
1 4 3 2
4 0 2 3
2
1 2
3 2
SAMPLE OUTPUT #1:
9
SAMPLE EXPLANATION #1:
TEST CASE #1:
n=4, m=2, points=[1, 4, 3, 2], height=[4, 0, 2, 3], index=[1, 2], minheight=[3, 2].
At 0th meter, we will climb the stairs and increase our height by 4. Therefore, height = 4, points collected = 0.
At 1st meter, we will collect the points. Therefore, height = 4, points collected = 4. Note, at index 1, we must have a height of 3, which is satisfied.
At 2nd meter, we will collect the points. Therefore, height = 4, points collected = 7. Note, at index 2, we must have a height of 2, which is satisfied.
At 3rd meter, we will collect the points. Therefore, height = 4, points collected = 9.
Therefore, the final answer is 9.
If you read whole description, please write down "I can do this within 5 usd."
thanks
Hi there,
I have a great experience in web development and javascript, jquery and prototype. I will do this project for you at 4 dollars. Contact me in the chat so that I can start working on it.
Regards,
Amandeep Singh