G. Soccer (soccer)
time limit per test
7 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
Input
3 3
0 0
2 5
5 3
1 3
2 8
2 2
Output
3
Input
5 8
0 0
1 64
2 36
3 10
4 10
1 47
1 26
3 51
2 5
2 11
4 67
4 24
3 8
Output
16
Input
10 18
0 0
1 91
2 7
3 27
4 99
5 93
6 38
7 30
8 54
9 43
8 75
7 86
5 10
2 22
8 69
6 83
4 88
5 99
1 38
3 78
9 69
1 30
4 17
2 78
6 65
7 42
9 32
3 76
Output
198