How do I take CodeChef input?

I just started on this site and am completely confused. How do you take the test case input? Could someone give a simple example?

Write a loop in any language you prefer.

Consider this problem

Following code is in python:

t = int(input())
while t:
    n, x = map(int, input().split())
    l = list(map(int, input().split()))
    t -= 1

Found my answer in this question: Life, the Universe and everything NodeJS Solution. - general - CodeChef Discuss. I will test it and come back witth the result.

This doesn’t help with the input. I use Javascript and am trying to figure out whether arguments are passed to a function or taken some other way.

Found a related question: Input in Javascript - general - CodeChef Discuss.