http://www.codechef.com/viewsolution/3269534 ran many test cases gave correct answer but showing wa
@anshkhanna:
check for this case:
1 1 0
actual output: 1
ur solution output:2
see here