logo AlgoBeat OnlineJudge
登录 注册

#102486. [BZOJ 2486] Super Poker

内存限制:128 MiB 时间限制:1000 ms 标准输入输出
题目类型:传统 评测方式:文本比较
上传者: 匿名

题目描述

I have a set of super poker cards,consisting of an infinite number of cards.For each positive integer ,there are exactly four cards whose value is :Spade(),Heart(),Club() and Diamond().There are no cards of other values.
Given two positive integers and ,how many ways can you pick up at most cards whose values sum to ?For example,if and ,ne way is ,shown below:

输入格式

There will be at most test cases,each with two integers and .The input is terminated by

输出格式

For each test case,print the number of ways,modulo

样例

样例输入 #1

2 1
2 2
2 3
50 5
0 0

样例输出 #1

4
10
10
1823966

数据范围与提示

的数据满足:

湖南省第七届大学生程序设计大赛

鸣谢刘汝佳先生授权使用