Comments

missed this. so naive.

This is all I did. Find maxes for each

p multiplied by each array item
q multiplied by each array item
r multiplied by each array item

and return the final sum. One test kept failing. Did we have to return sum%(10^9+7) or something?

Did we have to print answer modulo 1^9+7 or something for Problem B? My submission kept failing.