here is the ideone link … plz hlp
question link http://www.codechef.com/problems/MARCHA1/
sorry… i had completely misunderstood the problem now i have got the right algorithm plz ignore the question…
Irrespective of your tle it will give you a WA due to your printf statements. Correct it to Yes and No also correct your newline.