Go: package main

import "fmt"

var count int

func main() {
	var inputNum, inputCount int
	var resultArr [50]int
	for {
		fmt.Scanf("%d", &inputNum)
		resultArr[inputCount] = calcA(inputNum)
		inputCount++
	}
	for _, value := range resultArr {
		fmt.Println(value)
	}
}

func calcA(input int) int {
	for i := 0; i <= 9; i++ {
		calcB(input, i)
	}
	return count
}

func calcB(input, a int) {
	for i := 0; i <= 9; i++ {
		calcC(input, a, i)
	}
}

func calcC(input, a, b int) {
	for i := 0; i <= 9; i++ {
		calcD(input, a, b, i)
	}
}

func calcD(input, a, b, c int) {
	for i := 0; i <= 9; i++ {
		if a+b+c+i == input {
			count++
		}
	}
}

Python: INF=-1
memo=[[INF]*51 for i in range(5)]
def rec(i,n):
    if memo[i][n]!=INF:
        return memo[i][n]
    if i==4:
        return 1 if n==0 else 0
    for m in range(10):
        memo[i][n]+=rec(i+1,n-m)
    return memo[i][n]
while True:
    try:
        n=int(input())
        print(rec(0,n))
    except:
        break

Python: import sys
dataset = sys.stdin.readlines()
for n in dataset:
	n = int(n)
	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)

Python: import sys
a=[0]*51
for i in range(19):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-[0,a[i-10]*4][i>9]
for e in sys.stdin:print(a[int(e)])

Python: 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()

Python: import sys
a=[0]*51
for i in range(10):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6
for i in range(10,19):a[i]=a[36-i]=(i+3)*(i+2)*(i+1)//6-a[i-10]*4
for e in map(int,sys.stdin):print(a[e])

Python: 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)])

Python: import itertools, sys

d = {i: 0 for i in range(51)}
for i in itertools.combinations_with_replacement(range(0,10), 4):
    d[sum(i)] += 1
print(d)
for i in map(int, sys.stdin):
    print(d[i]*4)

Python: 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(i,j,k,l)

print(cnt)

Python: 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

Python: 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

Python: while(True):
    try:
        ans = 0
        n = 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 == n):
                            ans += 1
        print(ans)
    except Exception:
        break

Python: import sys

for num in sys.stdin:
    num = int(num)
    counter = 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) == num:
                        counter += 1
    print(counter)

Python: x=[0]*51
for a in range(10):
	for b in range(10):
		for c in range(10):
			for d in range(10):
				x[a+b+c+d]+=1
while True:
	try:
		print(x[int(input())])
	except:
		break

Python: # -*- coding: utf-8 -*-
while True:
    try:
        n = int(raw_input())
        case = 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:
                            case += 1
        print(case)
    except EOFError:
        break

Python: 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)

Python: import sys
a=[0]*51;x=range(10)
for i in range(51):
 a[i]=sum([1 for a in x for b in x for c in x for d in x if a+b+c+d==i])
for e in sys.stdin:
 print(a[int(e)])

Python: 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))

Python: from collections import deque
import sys

def solve(n, target):
    """ 0-9?????§?????°???n???????¶?????????¨??§???target??????????????????????????? """
    if n <= 1:
        if 0 <= target <=9:
            Q.append(target)
            return target
        else:
            return None
    else:
        for i in range(10):
            res = solve(n - 1, target - i)


Q = deque()
if __name__ == '__main__':
    # ??????????????\???
    for line in sys.stdin:
        target = int(line)

        result = solve(4, target)
        print(len(Q))
        Q.clear()

Python: import sys
from itertools import product
s = [sum(l) for l in product(range(10), repeat = 4)]

ns = sys.stdin.readlines()
for n in ns:
    print(s.count(int(n)))

Python: while True:
    try:
        n = int(input())
    except EOFError:
        break
    answer = 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:
                        answer += 1
    print(answer)

Python: #!/usr/bin/env python
# -*- conding: utf-8 -*-
import itertools
import sys
import math

for line in sys.stdin.readlines():
    n = int(line.strip())
    if n > 36:
        print(0)
        continue
    elif n == 36:
        print(1)
        continue
    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 and d <= 9:
                    cnt += 1
    print(cnt)

Python: 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

Python: for _ in range(50):
    try:
        n = int(input()) # 1 <= n <= 50
        ans =set()
        for a in range(10):
            if (n - a) >= 1:
                for b in range(10):
                    if(n - a -b) >= 1:
                        for c in range(10):
                            if(n - a - b - c) >= 1:
                                for d in range(10):
                                    if(n - a - b - c - d) == 0:
                                        ans.add("{},{},{},{}".format(a,b,c,d))
                                        ans.add("{},{},{},{}".format(b,c,d,a))
                                        ans.add("{},{},{},{}".format(c,d,a,b))
                                        ans.add("{},{},{},{}".format(d,a,b,c))
        print(len(ans))
    except EOFError:
        break