SRM 512 DIV2 256 pts
passed all cases

2 objs, different adjacent max length = 2*#min +1