Getting "Exception in thread “main” java.util.NoSuchElementException " error

My code is working perfectly fine on Eclipse but when I try to run it on Codechef I am getting this error.
I even tried to run it with custom input but it still gives the same error. Can somebody please have a look at my code and help me out why am I getting this error?

My Code: CodeChef: Practical coding for everyone

The Error :

Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextInt(Scanner.java:2117)
at java.util.Scanner.nextInt(Scanner.java:2076)
at Codechef.takeListInput(Main.java:194)
at Codechef.main(Main.java:311)

1 Like

Did you get solution??
Coz i am having same error and its frustrating.