title: Lucky Tickets (count an amount of lucky numbers, having the specified sum of ALL digits)
body: <p>Here is the <a href="http://acm.timus.ru/problem.aspx?space=1&amp;num=1036" rel="nofollow">problem</a></p>
  
  <blockquote>
    <p>You are given a number 1 ≤ N ≤ 50. Every ticket has its 2N-digit number. We call a ticket lucky, if the sum of its first N digits is equal to the sum of its last N digits. You are also given the sum of ALL digits in the number. Your task is to count an amount of lucky numbers, having the specified sum of ALL digits.</p>
  </blockquote>
  
  <p>For input 2 2 output is 4 (0101, 0110, 1001, 1010)</p>
  
  <p>Can you help me to solve this problem? What is the minimum complexity ?</p>