NERC Challenge 2020: Marathon


A. Fixing the Cloud
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1
100 500
200 1000
50 200
0 1
Output
1
1
0 1 0
Input
3 3
100 350
200 480
150 720
80 300
20 50
150 480
0 1
2 0
1 2
Output
3
1
2 0 1
1
1 2 2
1
0 1 0
Input
5 6
500 1000
100 200
500 1000
500 500
500 1000
200 500
50 50
200 500
50 150
50 50
50 50
0 2
2 0
3 4
1 2
2 0
0 1
Output
3
2
2 0 1
2 0 4
3
0 1 5
0 2 0
3 4 2
1
1 2 3
----------------------------------------------------------------------------------------------------
