Do I need to take the input for all testcases at once before processing it?
A. No, you need not take all the input at once. You can take the input for a particular test case and output the answer and then proceed to the next test case. Program should read from standard input and write into standard output. There is no need to read all data first, compute them all and then print all output. It is recommended to read and write data as simultaneously. Technically, server redirects standard stream to files. You can test you programs in the same way at home. Q. Can I get the input for which my program failed? A. Currently it is not possible to get the input for which your program fails. Thinking out corner cases is a part of the fun associated with algorithms Q. How do I take input for problems which do not specify a distinct terminating condition or the number of test cases? A. In cases where the total number of test cases are not specified or some input doesn’t serve as the terminating input, you are expected to take input till an EOF marker is encountered. While