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:

The Error :

Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(
at java.util.Scanner.nextInt(
at java.util.Scanner.nextInt(
at Codechef.takeListInput(
at Codechef.main(

1 Like

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