In an episode of the Dick Van Dyke show, little Richie connects the freckles on his...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ripley's engagement falls through. Consider Dick's back to be a plane with freckles at various (r, y) locations. Your job is to tell Richie how to connect the dots so as to minimize the amount of ink used. Richie connects the dots by drawing straight lines between pairs, possibly lifting the pen between lines. When Richie is done there must be a sequence of connected lines from any freckle to any other freckle. Input The input begins witha single positive integer on a line by itself indicating the number of the cases (at most 20) following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs. The first line of test case contains 0 <n< 1000, the number of freckles on Dick's back. For each freckle, a line follows; each following line contains two real numbers indicating the (r, y) coordinates of the freckle. The coordinates will be at most 100 000 in absolute value. Output For each test case, your program should print a single real number to two decimal places: the minimum total length of ink lines that can connect all the freckles. Put a blank line between outputs for consecutive test cases. Sample Input 1 Sample Output 1 1 3.41 1.0 1.0 Activat Go o Se 2.0 2.0 2.0 4.0 In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so his Ripley's engagement falls through. Consider Dick's back to be a plane with freckles at various (r, y) locations. Your job is to tell Richie how to connect the dots so as to minimize the amount of ink used. Richie connects the dots by drawing straight lines between pairs, possibly lifting the pen between lines. When Richie is done there must be a sequence of connected lines from any freckle to any other freckle. Input The input begins witha single positive integer on a line by itself indicating the number of the cases (at most 20) following, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs. The first line of test case contains 0 <n< 1000, the number of freckles on Dick's back. For each freckle, a line follows; each following line contains two real numbers indicating the (r, y) coordinates of the freckle. The coordinates will be at most 100 000 in absolute value. Output For each test case, your program should print a single real number to two decimal places: the minimum total length of ink lines that can connect all the freckles. Put a blank line between outputs for consecutive test cases. Sample Input 1 Sample Output 1 1 3.41 1.0 1.0 Activat Go o Se 2.0 2.0 2.0 4.0
Expert Answer:
Related Book For
Posted Date:
Students also viewed these accounting questions
-
In an episode of The Simpsons television show, Homer reads from a newspaper and announces Heres good news! According to this eye-catching article, SAT scores are declining at a slower rate. Interpret...
-
In an episode of the sitcom Seinfeld, Jerry and his friends Elaine and George are waiting to be seated at a Chinese restaurant. Tired of waiting, Elaine convinces the others that they should bribe...
-
In an episode of the television show House, Dr. House pulled the patients tracheostomy tube and viewed into the pharynx to find evidence of a pseudomembrane. He then contacted the CDC to obtain the...
-
Verify each identity by comparing the graph of the left side with the graph of the right side on a calculator. sin 4x(cos 2x - sin2x) sin 8x 2
-
A company has test-marketed three new types of soup in selected stores over a period of 1 year. The following table records sales achieved (in thousands of dollars) for each of the three soups in...
-
The average waiting time for a patient at an EL Paso physician's office is just over 29 minutes, well above the national average of 21 minutes. in fact, el Paso has the longest physician's office...
-
Most DBMS packages contain a data definition language, a data manipulation language, and a data query language. For each of the following examples, indicate which language would be used and why. a. A...
-
Grand Devices Corporation assembles handheld computers that have scaled-down capabilities of laptop computers. Each handheld computer takes 6 hours to assemble. Grand Devices uses a JIT production...
-
A mining company is considering a new project. Because the mine has received a permit, the project would be legal; but it would cause significant harm to a nearby river. The firm could spend an...
-
Design a class hierarchy to represent syntax trees for the CFG of Figure 4.5. Provide a method in each class to return the value of a node. Provide constructors that play the role of the make_leaf,...
-
Case Description This case is adapted from a case study developed by Meric, Dunne, Li and Meric (2010). Interested students can read the original case from the following source: Meric, I., Dunne, K.,...
-
How to write book review in not less than five thousands words? The name of book is "THE FIRST 90 DAYS" AUTHOR: Michael D. Watkins. Requirements: -APA 7 -Atleast 15 references -critical thinking...
-
How to do a CLOSING ARGUMENTS? Objective: To provide a clear and persuasive summary of (1) the evidence you need to prove the case, and (2) the weaknesses of the other side's case. Advice in...
-
Able Corp. ("Able") wants to purchase some steel fabricating equipment from Baker Inc. ("Baker"), but needs to make sure that the equipment is capable of fabricating at least 50 sheets of steel per...
-
So when talking about sustainability, we need to pay attention to these 3 elements, namely: - Social development (fairness and justice) - Conservation of natural resources (environmental protection);...
-
You bought a share of 5.9 percent preferred stock for $94.18 last year. The market price for your stock is now $97.17. What is your total return for last year? Assume a par value of $100. (Do not...
-
A hospital has contracted with an HMO to provide acute care inpatient services for $1,000 per day, subject to a 10 percent withhold. The proposed budget for inpatient services is based upon expected...
-
Identify the tax issues or problems suggested by the following situations. State each issue as a question. Jennifer did not file a tax return for 2007 because she honestly believed that no tax was...
-
The Sabin oral polio vaccine (OPV) is currently used in India and other developing countries around the world. Conduct additional research and discuss whether this method of immunization has been...
-
1. From chapter 4, figure. You may have seen similar sites in the environment. Can you think of two locations you encountered that have shown colorful evidence of microbial growth? 2. From chapter 1,...
-
a. Draw a bacterial cell and a eukaryotic cell side by side. Label where each of the following steps would take place: -Glycolysis -Krebs cycle -Electron transport b. Describe the fate of pyruvic...
-
The price elasticity of demand is defined as the percentage change in _________ divided by the percentage change in _________.
-
The price elasticity of demand measures the responsiveness of quantity _________ to a change in price.
-
Describe and explain how demand and supply determine prices and the quantities that are bought and sold.
Study smarter with the SolutionInn App