read input from a file; previous testcases moved to a file