Recently, more and more people are asking questions that have been answered many many times before. This FAQ covers virtually all of them, so please make sure you have read it before using this site.
In Java, do not create multiple BufferedReaders on the standard input stream. Create it once, and use it from there. Creating it multiple times will lead to a wrong answer due to the method Codechef uses to test your program. Different operating systems have different ways of representing a newline; do not assume one particular way will be used. For example, on Unix a newline is simply a \n character. On Windows, a newline is represented by \r\n, and not testing for the \r character will lead to problems. Ideally, use input reading functions from your language which handle new line issues for you.
We use cookies to improve your experience and for analytical purposes. Read our Privacy Policy and Terms to know more. You consent to our cookies if you continue to use our website.