Efficient Solutions

题目描述

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=22&page=show_problem&problem=1961 [PDF](https://uva.onlinejudge.org/external/110/p11020.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11020/9555df1056f76f0972b92e8ccf104c83edd473b5.png)

输入输出格式

输入格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11020/b64827292fcffd736f9f4993e60aedd179a5fbce.png)

输出格式


![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11020/f8b9cfef09bbbbdac2ebca9b87c3f4a3df45c53c.png)

输入输出样例

输入样例 #1

4
1
100 200
2
100 200
101 202
2
100 200
200 100
5
11 20
20 10
20 10
100 20
1 1

输出样例 #1

Case #1:
1

Case #2:
1
1

Case #3:
1
2

Case #4:
1
2
3
3
1