Reason of Error:- codechef testcases dont give “/n” i.e. enter (newline charecter) at the end of the input, which is fine with most programming languages like c and c++ but python input() only returns the value after it encounters a newline. so now u may be wondering how to solve this problem.
- switch to Non-IDE Mode.
- Use input().split() instead of input()
note:- in 2nd solution split() turns the input() str into a list divided by whitespaces.
also note that there is no argument in () of split().