Computer Science, asked by radhikashah0499, 3 months ago

There are N boxes placed in a row and M diamonds are distributed in these boxes such that each box contains at least 1 diamond into it. Each diamond is of certain colour and has a certain value. Formally, diamond i has colour Ci and value Vi. Each diamond is put in a certain box denoted by Bi. Now your task is to take exactly one diamond from each box such that total value of diamonds taken is maximum and diamonds taken from two consecutive boxes are of different colours. If it is impossible to satisfy the conditions, output -1.

Answers

Answered by harshsoni2210
0

Answer:

6

Explanation:

Jr and you are a very good day at and work on my way to get a new one for me I don't know which friend of my life is a lot more to go to now baby girl is the only one I have no another day in a few weeks and I was like what I said it was good to know you are a lot of things I do not know that

Similar questions