DIFNEIGH - EDITORIAL

@lakshitf Try

1
2 2

@agentproton try
1
5 1

https://www.codechef.com/viewsolution/22505362
can anyone tell me what’s wrong in this code?

@shristi_raj Try\

2
3 2
6 7

@petch
Sorry I put the wrong code here, my submission is : https://www.codechef.com/viewsolution/22482748

Please help me to find the wrong test case.

@lakshitf

1
2 5

Your output is

4
1 1 2 2 1
2 3 3 4 1

But you can use actually use at most 3 numbers:

3
1 2 3 1 2 
1 2 3 1 2

Please can someone suggest me what’s wrong in my code? I am not getting where am i going wrong.

https://www.codechef.com/viewsolution/22517943

this is my sample input and output:
input:

8
1 1
1 2
2 1
2 2
2 3
3 2
3 3
3 4

output:

1
1
1
1 1
1
1
1
2
1 1
2 2
3
1 2 3
1 2 3
3
1 1
2 2
3 3
4
1 1 2
3 3 4
2 2 1
4
1 1 2 2
3 3 4 4
2 2 1 1