here is the ideone link … plz hlp
question link MARCHA1 Problem - CodeChef
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.
sorry… i had completely misunderstood the problem now i have got the right algorithm plz ignore the question…