Problem:


Sum of 4 Integers

Write a program which reads an integer n  and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality:

a + b + c + d = n

For example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8).

Input

The input consists of several datasets. Each dataset consists of n (1 ≤ n ≤ 50) in a line. The number of datasets is less than or equal to 50.

Output

Print the number of combination in a line.

Sample Input

35
1

Output for the Sample Input

4
4



Sample input:
35
1


Sample output:
4
4

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math

errerN=1

while errerN:
    try:
        r=int(input())
        p=0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a+b+c+d==r:
                            p+=1
        print(p)
    except :
        errerN=0

Submission status: Accepted

Solution code:
while True :
    try :
        n = int(input())
    except EOFError :
        break
    
    cnt = 0
    for a in range(10) :
        for b in range(10) :
            for c in range(10) :
                for d in range(10) :
                    if a + b + c + d == n :
                        cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
while True:
    try:
        s=int(input())
        result=0
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for l in range(10):
                        if i+j+k+l==s:
                            result+=1
        print(result)   
    except EOFError:
        break

Submission status: Accepted

Solution code:
try:
    while True:
        #標準入力
        num = int(input())
        kei = 0
        #全パターン試す
        for num1 in range(0,10):
            for num2 in range(0,10):
                for num3 in range(0,10):
                    for num4 in range(0,10):
                        #合計が入力値と同じならカウントを増やす
                        if num1 + num2 + num3 + num4 == num:kei += 1
                        else:pass
        #出力
        print(kei)
#EOFErrorをひろう
except EOFError:
    pass

Submission status: Accepted

Solution code:
for line in open(0).readlines():
    N = int(line)
    lim = min(9, N)
    ans = 0
    if 0 <= N <= 36:
        for a in range(0, lim+1):
            for b in range(0, lim+1):
                for c in range(0, lim+1):
                    d = N - a - b - c
                    if 0 <= d <= lim:
                        ans += 1
    print(ans)

Submission status: Accepted

Solution code:

while True:
    try:
        count=0
        num = int(input())
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a+b+c+d ==num:
                            count+=1
        print(count)
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
  try:
    n = int(input())
    count = 0
    for a in range(10):
      for b in range(10):
        for c in range(10):
          for d in range(10): 
            if a + b + c + d == n:
              count += 1
    print(count)
  except EOFError:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        cnt =0
        a = int(input())
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for l in range(10):
                        if i+j+k+l == a:
                            cnt += 1
        print(cnt)
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        count = 0
        n = int(input())
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    d = n - a - b - c
                    if (d >= 0 and d <= 9):
                        count += 1
        print(count)
    except EOFError:
        break

Submission status: Accepted

Solution code:
import itertools

try:
    while True:
        n = int(input())
        
        count = 0
        for a, b, c, d in itertools.product(range(10), repeat=4):
            if a + b + c + d == n:
                count += 1

        print(count)

except Exception as _:
    pass

Submission status: Accepted

Solution code:
while True:
    try:
        i = 0
        a = list(map(int,input().split()))
        for x in range(10):
            for y in range(10):
                for z in range(10):
                    for s in range(10):
                        if a[0]==(x+y+z+s):
                            i = i+1
                        else:
                            pass
        print(i)
    except EOFError:
        break

Submission status: Accepted

Solution code:
output = 0
try:
    while True:
        n = int(input())
        a = 0
        while a < 10 :
            b = 0
            while b < 10 :
                c = 0
                while c < 10 :
                    d = 0
                    while d < 10 :
                        if a + b + c + d == n :
                            output += 1
                        d += 1
                    c += 1
                b += 1
            a += 1
        print(output)
        output = 0
except EOFError:
    pass

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
    except:break
    ans = 0
    for i in range(0,10):
        for j in range(0,10):
            for k in range(0,10):
                for l in range(0,10):
                    if i + j + k + l == n:
                        ans += 1

    print(ans)

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    n = int(line)
    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == n:
                        cnt += 1;
    print(cnt)

Submission status: Accepted

Solution code:
import sys; print("\n".join(str(sum(1 for n in [int(in_n)] for a in range(10) for b in range(a, a+10) for c in range(b, b+10) for d in range(c, c+10) if d == n)) for in_n in sys.stdin))

Submission status: Accepted

Solution code:
while True :
    try :
        n = int(input())
        
    except :
        break
    
    S = [(0, 0, 0, 0) for i in range(10000)]
    s = 0
        
    for a in range(10) :
        for b in range(10) :
            for c in range(10) :
                for d in range(10) :
                    if(a + b + c + d == n) :
                        S[s] = (a, b, c, d)
                        s += 1
                    else :
                        pass
        
    S = set(S)
        
    print(len(S) - 1)

Submission status: Accepted

Solution code:
from itertools import product

while True:
    try:
        total = int(input())
        c = 0
        for t in product(range(10),repeat=4):
            if total == sum(t):
                c += 1
        print(c)

    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        num = 0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if (a + b + c + d == n):
                            num += 1
        print(num)
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        count = 0
        n = int(input())
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a + b + c + d == n:
                            count += 1
        print(count)
    except:
        break

Submission status: Accepted

Solution code:
import sys
try:
    while True:
        n = int(input())
        
        res = 0
        
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for m in range(10):
                        if i + j + k + m == n:
                            res += 1
        
        print(res)
except Exception:
    sys.exit()

Submission status: Accepted

Solution code:
a = [0 for i in range(51)]
for i in range(10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        a[i + j + k + l] += 1
while True:
  try:
    n = int(input())
    print(a[n])
    
  except EOFError:
    break

Submission status: Accepted

Solution code:
e=[0]*51
for a in range(10):
  for b in range(10):
    for c in range(10):
      for d in range(10):
        e[sum([a,b,c,d])]+=1
while 1:
  try:
    print(e[int(input())])
  except:
    break

Submission status: Accepted

Solution code:
ans = [0 for i in range(51)]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                ans[i+j+k+l] += 1
#for i in range(50+1):
#   print(i, ans[i])
     
while True:
    try:
        print(ans[int(input())])
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
  try:
    n = int(input())
    count = 0
    for a in range(10):
      for b in range(10):
        for c in range(10):
          for d in range(10):
           if a+b+c+d==n:
              count += 1
    print(count)
  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
r = range(10)
for l in sys.stdin: print(len([[a,b,c,d]for a in r for b in r for c in r for d in r if a+b+c+d==int(l)]))

Submission status: Accepted

Solution code:
import itertools
try:
    while(True):
        n = int(input())
        cnt = 0
        rng = range(10)
        for i,j,k,l in itertools.product(rng,rng,rng,rng):
            if i + j + k + l == n:
                cnt = cnt + 1
        print(cnt)
except:
    pass

Submission status: Accepted

Solution code:

while True:
 try:
   n = int(input())
   ans =0
   for a in range(10):
     for b in range(10):
       for c in range(10):
         for d in range(10):
           if a+b+c+d==n:
             ans=ans+1
   print(ans)
 except:
   break

Submission status: Accepted

Solution code:
while True:
  try:
    n = int(input())
    ans =0
    for a in range(10):
      for b in range(10):
        for c in range(10):
          for d in range(10):
            if a+b+c+d==n:
              ans=ans+1
    print(ans)
  except:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        n=int(input())
    except:
        break
    cnt=0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if i+j+k+l==n:
                        cnt+=1
    print(cnt)

Submission status: Accepted

Solution code:
import itertools
import sys
com = [0] * 51
r10 = range(10)
for a,b,c,d in itertools.product(r10,r10,r10,r10):
    com[a+b+c+d] += 1
for line in sys.stdin.readlines():
    print(com[int(line)])

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':

	for n in sys.stdin:
		cnt = 0

		for i in range(10):
			for j in range(10):
				for k in range(10):
					for l in range(10):
						if i+j+k+l == int(n):
							cnt +=1

		print(cnt)

Submission status: Accepted

Solution code:
a = [0 for i in range(51)]
for i in range(10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        a[i + j + k + l] += 1
while True:
  try:
    n = int(input())
    print(a[n])
   
  except EOFError:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        counter = 0

        for o in range(10):
            for p in range(10):
                for q in range(10):
                    for r in range(10):
                        if (o + p + q + r) == n:
                            counter = counter + 1

        print(counter)
    except:
        break

Submission status: Accepted

Solution code:
while True:
  try:
    n=int(input())
    count=0
    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            if (i+j+k+l)==n:
              count=count+1
    print(count)
    
  except EOFError:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        inVal = int(input())
        count = 0;
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a + b + c + d == inVal:
                            count = count + 1
        print(count)
    except EOFError:
        break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
	n = int(line)
	cnt = 0
	for i in range(0, 10):
		for j in range(0, 10):
			for k in range(0, 10):
				for p in range(0, 10):
					if i+j+k+p == n:
						cnt += 1
						break
				if i+j+k == n: break
			if i+j == n: break
		if i == n: break
	print cnt

Submission status: Accepted

Solution code:
def wa(n):
    count=0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if n==i+j+k+l:
                        count +=1
                    elif n<i+j+k+l:
                        break
    return count
while True:
    try:
        n=int(input())
        print(wa(n))
    except:break

Submission status: Accepted

Solution code:
while True:
  counter = 0
  try:
    n = int(input())
  except EOFError:
    break
  for a in range(10):
    for b in range(10):
      for c in range(10):
        for d in range(10):
          if a+b+c+d == n:
            counter += 1
  print(counter)

Submission status: Accepted

Solution code:
while 1:
    try:
        n=int(input())
        i=0
        for a in range(10):
            for b in range(10):
                for c in range(10):
                    for d in range(10):
                        if a+b+c+d==n:i+=1
        print(i)
    except:break

Submission status: Accepted

Solution code:
def calc(n, x):
    # n個の数(0~9)の和でxが作れるかどうかを判別する
    if n == 1:
        if x <= 9:
            return 1
        else:
            return 0
    else:
        num = 0
        for i in range(10):
            if x-i < 0:
                continue
            num += calc(n-1, x-i)
        return num


while True:
    try:
        print(calc(4, int(input())))
    except:
        exit(0)

Submission status: Accepted

Solution code:
try:
    while True:
        n=int(input())
        cnt=0
        for a,b,c,d in [(a,b,c,d) for a in range(10) for b in range(10) for c in range(10) for d in range(10)]:
            if a+b+c+d==n:
                cnt+=1
        print(cnt)
except EOFError:
    pass

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    while True:
        try:
            n = int(input())
            counter = 0
            for a in range(10):
                for b in range(10):
                    for c in range(10):
                        for d in range(10):
                            if a + b + c + d == n:
                                counter += 1
            print(counter)
        except EOFError:
            break

Submission status: Accepted

Solution code:
import sys
  
n = [0]*51
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                n[i+j+k+l] += 1

for i in sys.stdin:
    print(n[int(i)])

Submission status: Accepted

Solution code:
def count(a):#関数「count」を定義
	count = 0
	if a<=36:
		for i in range(10):#()内は0から一つ前までの数
			for j in range(10):
				for k in range(10):
					for l in range(10):
						if i+j+k+l==a:
							count +=1
	print(count)
while True:
	try:
		a=int(input())
		count(a)
	except EOFError:
		break

Submission status: Accepted

Solution code:
while True:
	try:
		n = int(input())
	except EOFError:
		break
	if n>36:
		print(0)
		continue
	ret=0
	for a in range(10):
		for b in range(10):
			for c in range(10):
				for d in range(10):
					if a+b+c+d==n:
						ret+=1
	print(ret)

Submission status: Accepted

Solution code:
while True:
  try:
    sum = int(input())
    result = 0
    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            if i+j+k+l == sum:
              result+=1
    print(result)
  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin:
    n = int(line)
    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == n:
                        cnt += 1;
    print(cnt)

Submission status: Accepted

Solution code:
import sys

def comb(n):
    count = 0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if i+j+k+l == n:
                        count += 1
                        continue
    return count


while True:
    line = sys.stdin.readline()
    if not line: break
    n = int(line.rstrip('\r\n'))
    print(comb(n))

Submission status: Accepted

Solution code:
def count(n):
    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                for d in range(10):
                    if a + b + c + d == n:
                        cnt += 1
    print(cnt)

while True:
    try:
        n = int(input())
        count(n)
    except EOFError:
        break

Submission status: Accepted

Solution code:
while(1):
    try:
        n = int(input())
    except:
        break

    cnt = 0
    for a in range(10):
        for b in range(10):
            for c in range(10):
                d = n - a - b - c
                if 0 <= d < 10:
                    cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
import itertools

while True:
    try:
        n = int(input())
        ans = 0
        for val in itertools.product(range(10), repeat=4):
            if sum(val) == n:
                ans += 1
        print(ans)
    except:
        break

Submission status: Accepted

Solution code:
while(True):
    try:
        N = int(input())
        m = 0
        for i in range(10):
            for j in range(10):
                for k in range(10):
                    for l in range(10):
                        if i+j+k+l == N:
                            m += 1
        print(m)
    except:
        break

Submission status: Accepted

Solution code:
ans = []

while True :
    try :
        N = int(input())
        used = []

        cnt = 0
        
        for a in range(10) :
            for b in range(10) :
                for c in range(10) :
                    for d in range(10) :
                        if a + b + c + d == N :
                            cnt += 1

        print(cnt)

    except :
        break

Submission status: Accepted

Solution code:
while True:
  try:
    n = int(input())
    results = []
    for i in range(10):
      for j in range(10):
        for k in range(10):
          for l in range(10):
            results.append( n == sum([i, j, k, l]) )
    print(len(list(filter(lambda x:x==True, results))))
  except:
    break

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
    n = int(line)
    count = 0
    for i in range(0, 10):
        for j in range(0, 10):
            for k in range(0, 10):
                for l in range(0, 10):
                    if i + j + k + l == n:
                        count += 1
    print(count)

Submission status: Accepted

Solution code:
num = [0 for i in range(51)]
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                num[a+b+c+d] += 1
while 1:
    try:
        print(num[int(input())])
    except:
        break

Submission status: Accepted

Solution code:
ss = int(input())
r = 10
while 1:
	cnt = 0
	for a in range(r):
		for b in range(r):
			for c in range(r):
				for d in range(r):
					if a+b+c+d==ss: cnt+=1
	print(cnt)
	try: ss = int(input())
	except EOFError: break

Submission status: Accepted

Solution code:
while True:
	try:
		n = int(raw_input())
		judge = 0
		for i in range(10):
			for j in range(10):
				for k in range(10):
					if -1 < n - i - j - k < 10:
						judge += 1
		print judge
	except EOFError:
		break

Submission status: Runtime Error

Solution code:
import itertools

l = [1,2,3,4,5,6,7,8,9]

while True:
    try:
        N = int(raw_input())
        res = 0
        for element in itertools.combinations_with_replacement(l,5):
          if sum(element) == N:
          res += 1
        print res
    except EOFError:
        break

Submission status: Runtime Error

Solution code:
while(True):
    a = 0
    n = int(input())

    if n > 36:
        print(0)
        continue
    elif n==36:
        print(1)
        continue
    b = n
    for i in range(10):
        if n-i==0:
            a=a+1
            #print("(%d,0,0,0)"%(i))
            break
        for j in range(10):
            if n-i-j==0:
                a=a+1
                #print("(%d,%d,0,0)"%(i,j))
                break
            for k in range(10):
                b = n-i-j-k
                if b>=0 and b<=9:
                    a=a+1
                    #print("(%d,%d,%d,%d)"%(i,j,k,b))
                    continue
                elif b > 9:
                    continue
                else:
                    break
                    
    
    print(a)

Submission status: Runtime Error

Solution code:
while(True):
    a = 0
    n = int(input())

    if n > 36:
        print(0)
        continue
    elif n==36:
        print(1)
        continue
    b = n
    for i in range(10):
        if n-i==0:
            a=a+1
            #print("(%d,0,0,0)"%(i))
            break
        for j in range(10):
            if n-i-j==0:
                a=a+1
                #print("(%d,%d,0,0)"%(i,j))
                break
            for k in range(10):
                b = n-i-j-k
                if b>=0 and b<=9:
                    a=a+1
                    #print("(%d,%d,%d,%d)"%(i,j,k,b))
                    continue
                elif b > 9:
                    continue
                else:
                    break
                    
    
    print(a)
return 0

Submission status: Runtime Error

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(raw_input())
        except EOFError:
            break

ar = [0] * 50

for i in range(10):
	for j in range(10):
		for k in range(10):
			for l in range(10):
				ar[i + j + k + l] += 1

for a in list(get_input()):

	print ar[int(a)]

Submission status: Runtime Error

Solution code:
import sys
s=[0]*51
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				s[a+b+c+d]+=1
for l in sys.stdin:print x[int(l)]

Submission status: Runtime Error

Solution code:
while 1:
    try:
        n=int(raw_input())
    except EOFError:
        break
    print len(=[1 for i in range(10) for j in range(10) for k in range(10) for l in range(10) if i+j+k+l==n]

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python
 
n = int(raw_input())
 
x = 0
i = rge(10)
 
 
for a in i:
    for b in i:
        for c in i:
            for d in i:
                if a + b + c + d == n:
                    x = x + 1
print x

Submission status: Runtime Error

Solution code:
import itertools


c = list(itertools.product(range(10), repeat=4))

if __name__ == '__main__':
    for line in sys.stdin.readlines():
        print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

if __name__ == '__main__':
    for line in sys.stdin.readlines():
        print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

for line in sys.stdin.readlines():
    print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

if __name__ == '__main__':
    for n in sys.stdin.readlines():
        print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

for n in sys.stdin.readlines():
    print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

for n in sys.stdin.readlines():
    print sum([l for l in c if int(n.strip()) == sum(l)])

Submission status: Runtime Error

Solution code:
import itertools
import sys


c = list(itertools.product(range(10), repeat=4))

for n in sys.stdin.readline():
    print sum([l for l in c if int(n) == sum(l)])

Submission status: Runtime Error

Solution code:
import sys


for n in sys.stdin.readline():
    ret = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == int(n):
                        ret += 1
    print ret

Submission status: Runtime Error

Solution code:
def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))
while 1==1:
    print(count(int(input())))

Submission status: Runtime Error

Solution code:
def count(num):    
    l1=[]
    for a in range (10):
        for b in range(10):
            for c in range (10):
                for d in range (10):
                    l1.append([a,b,c,d])
    l1=list(filter(lambda x: sum(x)==num,l1))
    return(len(l1))
import sys
length=len(sys.stdin.readlines())
for i in range (length):
    print(count(int(input())))

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin.readline():
    line.strip()
    a=int(line)
    if a<37:
        cnt=0
        for i in xrange(0,10):
            for j in xrange(0,10):
                for k in xrange(0,10):
                    for l in xrange(0,10):
                        if i+j+k+l==a:
                            cnt+=1
        print cnt
    else:
    	print 0

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import sys

sum = [0]*37
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                sum[a+b+c+d] += 1
for line in sys.stdin:
    print sum[int(line)]

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main(num): 
	if num >= 19:
		num = 19 - num + 17
	res = 1
	gro1 = 3
	for i in range(8):
		if i == num:
			return res
		if i == 0:
			gro2 = 3
		else:
			gro2 += 1
		res += gro1
		gro1 += gro2
	
	for i in range(8,19):
		if i == num:
			return res
		gro2 -= 3
		res += gro1
		gro1 += gro2
			
		
if __name__ == '__main__':
	while True:
		try:
			num = int(input())
		except:
			return
		else:
			print(main())

Submission status: Runtime Error

Solution code:
while 1:
    n=int(input())
    cnt=0
    for i in range(10):
        for j in range(10):
            for k in range(10):
                for l in range(10):
                    if i+j+k+l==n:
                        cnt=cnt+1
    print(cnt)

Submission status: Runtime Error

Solution code:
while True:
	n = int(input())
	counter = 0
	for a in range(10):
		for b in range(10):
			for c in range(10):
				for d in range(10):
					if a + b + c + d == n:
						counter += 1
	print(counter)

Submission status: Runtime Error

Solution code:
while True:
    try:
        n = int(input())
        c = 0
        for i in range(1,10):
            for j in range(1,10):
                for k in range(1,10):
                    for l in range(1,10):
                        if i+j+k+l == n : c+=1
        print(c)
    exception:
        break

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    N = int(raw_input())
    ans = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == D:
                        ans += 1
    print ans

Submission status: Runtime Error

Solution code:
import sys
for line in sys.stdin:
    N = int(raw_input())
    ans = 0
    for a in xrange(10):
        for b in xrange(10):
            for c in xrange(10):
                for d in xrange(10):
                    if a+b+c+d == N:
                        ans += 1
    print ans

Submission status: Runtime Error

Solution code:
againstN = [0]*50

for a in range(0,10):
  for b in range(0,10):
    for c in range(0,10):
      for d in range(0,10):
        againstN[a+b+c+d] += 1

inputs=[]
while True:
  try:
    inputs.append(int(input()))
  except EOFError:
    break

for i in inputs:
  print(againstN[i])

Submission status: Runtime Error

Solution code:
import sys
values = []
for line in sys.stdin:
    values.append(int(line))
ans = [1 for i in range(10) for j in range(10) for k in range(10) for l in range(10) if n == i + j + k + l]
print(ans.count(1))

Submission status: Runtime Error

Solution code:
import sys

a=[]

for num in sys.stdin:
  a.append(num)

for i in a:
  time=0

  if n<=18:
    for i in range(n+1):
      if i<=9:
        if n-i<=9:
          time+=(i+1)*(n-i+1)
        else:
          time+=(i+1)*(19-n+i)
      else:
        time+=(19-i)*(n-i+1)
  elif n>18 and n<=36:
    for i in range(37-n):
      pre=i+n-18
      if pre<=9
        time+=(pre+1)*(19-n+pre)
      else:
        if n-pre<=9:
          time+=(19-pre)*(n-pre+1)
        else:
          time+=(19-pre)*(19-n+pre)
  print time

Submission status: Runtime Error

Solution code:
import sys

a=[]

for num in sys.stdin:
  a.append(num)

for i in a:
  time=0

  if n<=18:
    for i in range(n+1):
      if i<=9:
        if n-i<=9:
          time+=(i+1)*(n-i+1)
        else:
          time+=(i+1)*(19-n+i)
      else:
        time+=(19-i)*(n-i+1)
  elif n>18 and n<=36:
    for i in range(37-n):
      pre=i+n-18
      if pre<=9:
        time+=(pre+1)*(19-n+pre)
      else:
        if n-pre<=9:
          time+=(19-pre)*(n-pre+1)
        else:
          time+=(19-pre)*(19-n+pre)
  print time

Submission status: Runtime Error

Solution code:
import sys
from itertools import product

num = 4
l = [0] * (9*num + 1)
for x in map(sum, product(range(10), repeat=num)):
    l[x] += 1

for s in sys.stdin:
    print(l[int(s)])

Submission status: Runtime Error

Solution code:
import sys

a=[]

for i in sys.stdin
	ini=input()
	a.append(ini)

for i in a:
	count=0
	for j in range(10):
		if j<=i and i-j<=27:
			for k in range(10):
				if k<=i-j and i-j-k<=18:
					if i-j-k<=9:
						count+=i-j-k+1
					else:
						count+=19-i+j+k
	print count

Submission status: Runtime Error

Solution code:
import sys

a=[]

for i in sys.stdin:
	ini=input()
	a.append(ini)

for i in a:
	count=0
	for j in range(10):
		if j<=i and i-j<=27:
			for k in range(10):
				if k<=i-j and i-j-k<=18:
					if i-j-k<=9:
						count+=i-j-k+1
					else:
						count+=19-i+j+k
	print count
???

Submission status: Runtime Error

Solution code:
import sys

a=[]

for i in sys.stdin:
	ini=input()
	a.append(ini)

for i in a:
	count=0
	for j in range(10):
		if j<=i and i-j<=27:
			for k in range(10):
				if k<=i-j and i-j-k<=18:
					if i-j-k<=9:
						count+=i-j-k+1
					else:
						count+=19-i+j+k
	print count