Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dr. Jackson, a researcher, wishes to perform an experiment. He has a variety of toxic chemicals. Each chemical has some vapor rate. When two chemicals

Dr. Jackson, a researcher, wishes to perform an experiment. He has a variety of toxic chemicals. Each chemical has some vapor rate. When two chemicals are mixed, then the vapor rate of the mixture is the multiplication of their respective vapor rates. Dr. Jackson picks two equal-sized sets of non-overlapping,consecutively placed chemicals from a series of chemicals in his lab.He reverses the positions of the chemicals in th set. He then mixes each chemicals from the set. He then mixes each chemical from the first set with the correspondin-placed chemicals of second set.The total vapor rate at the end of the experiment is the sum of the products of respective vapor rates of the chemicals that he mixed from both sets .If the total vapor rate is negatie, he will not pick any set. Write an alogoritm to find the maximum vapor rate obtained after the experiment. Input first line is number N ,chemicals in series ,The second line consists of N space seprated integers. Output print an integer representing the maximum vapor rate after the experiment. Constraints 2<=num<=3000 0<=2*S<=num,where S is the size of the set -10^6<=vaporRate<=10^6 0<=i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

what is cryptography? how it works?

Answered: 1 week ago