Greedy - though simple, but fun! #include <vector>#include<iostream>usingnamespacestd;intmain(){intn1;intn2;intn3; cin>> n1 >> n2 >>n3;longlongl1 =0, l2 =0, l3 =0; vector<int>h1(n1);for(inth1_i =0;h1_i < n1;h1_i++){ cin>>h1[h1_i]; l1+=h1[h1_i]; } vector<...
You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height. You can change the height of a stack by removing and discarding its topmost cylinder any number of times. Find the maximum possible height of the stacks such that all of the stacks ...