fork(7) download
  1. # your code goes here
  2.  
  3. def runic_numbers(size):
  4. s = set()
  5. for i in range(size+1):
  6. for v in range(size+1-i):
  7. for x in range(size+1-i-v):
  8. l = size-i-v-x
  9. if l>=0:
  10. s.add(1*i+5*v+10*x+50*l)
  11. return len(s)
  12.  
  13. for size in range(1,20):
  14. print(size, runic_numbers(size))
  15.  
  16. print(runic_numbers(109))
Success #stdin #stdout 0.1s 9884KB
stdin
Standard input is empty
stdout
1 4
2 10
3 20
4 35
5 56
6 83
7 116
8 155
9 198
10 244
11 292
12 341
13 390
14 439
15 488
16 537
17 586
18 635
19 684
5094