The input contains multiple test cases.
For each test case:
The first line contains two positive integers
m
and k
, satisfying that 1≤m,k≤10
.
In next m
lines, the i
-th line contains two positive integers p
i![技术分享]()
and e
i![技术分享]()
, satisfying that 2≤p
i
≤10
9
,
e
i
≥1,
∑
m
i=1
e
i
≤10
5![技术分享]()
.
It is guaranteed that p
1
,p
2
,?,p
m![技术分享]()
are distinct.
About 200
test cases in total, where no more than 5
cases satisfy ∑
m
i=1
e
i
≥10
4![技术分享]()
.
1 1
2 2
2 1
3 1
5 1
1 2
2 3
2 2
2 4
5 4
Case #1: 2
Case #2: 3
Case #3: 6 4
Case #4: 1499980 1281085