• [F] Fit The Equation

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • XP is a very clever boy. When he was in primary school, he could solve some difficut math problems. For example, he could get the answer of problem 12 + 32= ? in five minutes. But he is poor in solving equations. But now, XP is no longer a little kid. He has made a great improvement in solving equations. He can solve a large number of diverse equations. He always show this skill in front of EG; He created a equation:x1+x2+...+xk=f(n), f(n)=(n^n)%1111, xi(i=1, 2 ,...,k)is a positive integer. Find out how many groups of x1,x2...xk fulfil the equation?. He said to EG " you can't solve it in one week ". EG understood you knew how to solve it, so she asks you for help, and she said if you can solve it, she would give you kiss.
  • 输入
  • A line with two integers k(1<=k<=111) and n(0<=n<=2^31-1). k and n stand for the interger in the description.
  • 输出
  • One line with the number of groups of answer.
  • 样例输入
  • 2 2
    2 3
  • 样例输出
  • 3
    26
  • 提示
  • The first case: 1+3=4 2+2=4 3+1=4 ,so the answer is 3.
  • 来源
  • 加多宝凉茶
  • 操作

显示春菜