Doubt regading subtask in problem code:WDTBAM https://www.codechef.com/problems/WDTBAM

This is my code and i am unable to understand why i didn’t get points for subtask 2 , task # 1.Please help me.