Swadhin and his Trip
All submissions for this problem are available.Swadhin wants to visit Disneyland but cannot afford it. Navya and Chakradhar being good friends of his decided to contribute money to pay for his trip. Finally they got enough money to fund his travel expenses. Once in Disneyland, Swadhin is very confused with the directions. He takes a stance that he'll only walk in the **North,South,East** or **West** direction so that he remembers the path he came from. He has a map with him in which cartesian coordinates($x_i$ and $y_i$) for every ride have been given. There are $N$ rides in Disneyland. Swadhin wants all of the rides, in a way that he goes from one ride to all other rides pairwise, ie, from every $ith$ ride to all $N-1$ rides. After a day of enjoyment, while returning back, Navya and Chakradhar want to know the total distance Swadhin travelled while in Disneyland. Swadhin needs your help calculating this distance, can you help him out? ###Input: - The first line consists of $N$, the total number of rides in Disneyland. - The next $N$ lines consist of the $x$ and $y$ coordinate of the $i-th$ ride where $(1 <= i <= N)$ ###Output: - For each testcase,output only one integer, the total distance. As this maybe very large, print the total distance modulo $10^9 + 7$. ###Constraints - $1 \leq N \leq 200000$ - $1 \leq |x_i| \leq 10^9$ - $1 \leq |y_i| \leq 10^9$ ###Subtasks - 30 points: $1 \leq N \leq 100$ - 70 points: Original Constraints ###Sample Input: 4 1 1 2 2 3 3 5 5 ###Sample Output: 26
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.