any python code boils down to this error on coding blocks website.
Please note it is running fine on my local system.
##Traceback (most recent call last):
File “source”, line 13, in
t = int(input())
EOFError: EOF when reading a line
My code is :
def ncr(n, r):
ans = 1
j = 1
for i in range(n,n-r,-1):
ans = ans *i
ans = ans//j
j+=1
return ans
def countWays(n, k):
if n == k:
return 1
return ncr(n-1,k-1)
t = int(input())
while t>0:
n,k = map(int,input().split(" "))
print(countWays(n,k))
t-=1