Help with distances
CodeChefOpen on judge ↗
Rahul has been given a new task. He has been given N points on the x-axis, X1,X2,...,XN. Now he is being asked Q queries. Each query gives him his position on the x-axis X, and asks him the sum of distances from his position and the N points. As the sum can be quite large, he has been told to print the answer modulo 7630367. He has written a program to calculate every query, but it seems to be
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start