the problem is here http://codeforces.net/problemset/problem/472/D the solution like 8041817(the first several solution onhttp://codeforces.net/problemset/status/472/problem/D ) can not pass follow test data
4
0 1 3 2
1 0 2 3
3 2 0 1
2 3 1 0
the test data is not strong enough 0.0