2018.9 ECNU ICPC/CCPC Trial Round #2

U. Ultmaster Dividing The Cake
PDF 题面可用
你可以在这里下载。

单点时限: 2.0 sec

内存限制: 512 MB

样例

Input
5
0 0
3 0
3 1
2 2
0 1
Output
7 2
Input
6
0 1
1 0
2 0
3 1
2 2
0 2
Output
6 3
Input
4
-100000000 -100000000
100000000 -100000000
100000000 100000000
-100000000 100000000
Output
40000000000000000 40000000000000000
Input
4
-99999995 -100000000
100000000 -100000000
100000000 99999995
-100000000 100000000
Output
39999999999999975 39999998000000025