4611: P1358 扑克牌

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

#1
5 2
3 1

#2
20 19
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Sample Output Copy

#1
20

#2
8707

HINT