Https://www.codechef.com/viewsolution/38110907

solution: https://www.codechef.com/viewsolution/38110907

problem: https://www.codechef.com/LRNDSA04/problems/QHOUSE

kindly help,just two cases are not working…i m not getting where im going wrong .