Rosetta Problems

Distance Pairs

https://atcoder.jp/contests/cf16-exhibition/tasks/codefestival_2016_ex_a