Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 6.00

James Moriarty

James Moriarty planted few bombs all over the city. But sadly there is only one bomb defusing squad, and is at a fixed position (X,Y). Sherlock Holmes was able to find out the positions of all the bombs. So all the bombs are to be disarmed in order to save the city. Since this is a very dangerous task thus no body volunteered.

Sherlock is initially at position (X,Y) and can carry only one bomb at a time. He has to bring all the bombs to the bomb defusing squad. Obviously he wants to do this task as soon as possible.

Given the position of the Squad and position of all the bombs, you need to tell the minimum distance that Sherlock Holmes has to travel to save the city.

Input

First line contains test cases T

Then first line of each test case tells the no. of bombs N ( 3

Next line contain the position of squad X Y ( X,Y

Next N lines denotes the position of bombs- xi yi (xi,yi

Output

For each test case output the minimum distance that Sherlock Holmes will travel.

Note: Bomb Squad is fixed and can not move. Initially Sherlock Holmes is standing with the squad. All the positions are integers. Minimum Distance between two points x1 y1 and x2 y2 is | x1-x2 | + | y1-y2 |.

Example

Input: 1 3 3 4 5 6 2 1 2 3 Output: 20

Answers

(5)
Status NEW Posted 17 Sep 2017 05:09 AM My Price 6.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)