Prata skoj problem


why my code is giving wrong output
can you please help

Your value of e is wrong. Take it as the rank of first cook multiplied with n*(n+1)/2