|
||||||||||
StringTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2806 Accepted Submission(s): 848 Problem Description Recently, lxhgww received a task : to generate strings contain '0's and '1's only, in which '0' appears exactly m times, '1' appears exactly n times. Also, any prefix string of it must satisfy the situation that the number of 1's can not be smaller than the number of 0's . But he can't calculate the number of satisfied strings. Can you help him? Input T(T<=100) in the first line is the case number. Each case contains two numbers n and m( 1 <= m <= n <= 1000000 ). Output Output the number of satisfied strings % 20100501. Sample Input
Sample Output
Author lxhgww Source | ||||||||||
|