F. Root Distance Sum (rootsum)
time limit per test
3 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

Due to Polygon's restriction that prevents uploading output files, we are unable to compute the exact answers. Therefore, on Codeforces your solution will be compared with the model solution using a accuracy requirement of 2% instead of 1%.