Find Jobs
Hire Freelancers

I'm finding experienced javascript developer.

$4-5 USD / hour

Cerrado
Publicado hace más de 3 años

$4-5 USD / hour

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
ID del proyecto: 29255883

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 3 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
2 freelancers están ofertando un promedio de $5 USD /hora por este trabajo
Avatar del usuario
I can do this within 5 usd. Hi, there. Hope you are doing well. Reach out me on here so that and we can discuss in detail. Regards.
$5 USD en 40 días
0,0 (1 comentario)
0,0
0,0
Avatar del usuario
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
$4 USD en 40 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de LATVIA
Iecava, Latvia
5,0
1
Miembro desde ene 6, 2021

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.