BS2DP1 the undefeated giant

Most unsuccessful submissions registered for this question.
Question statement was so simple but the coding part only 98℅ failed😂

https://www.codechef.com/BSP22021/problems/BS2DP1