LEBALONS - Editorial

@darkshadows
http://www.codechef.com/viewsolution/3915467

Could anyone point out the mistake in this ?
Seems correct :frowning:
Thanks

@betlista can you please tell what is wrong with this code. Though it gives correct ans, it is wa on codechef. this is the result on codechef. Thanks!

Can anybody point out the error in the code.

I cross checked it with the tester’s solution on some test cases.

http://www.codechef.com/viewsolution/3973475

I am getting a WA. If anyone could explain the reason or the test case, thanks for the same.

the cost of selecting the ith color is last two terms collectively