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
-
1. Did Harry make a rational decision? 2. What model of behavioral decision making does this case support? 3. What decision techniques that were discussed in the chapter could be used by the...
-
Susans Consulting experienced the following transactions for 2014, its first year of operations, and 2015. Assume that all transactions involve the receipt or payment of cash. Transactions for 2014...
-
CGI Federal, Inc., is a corporation that provides a number of services to the United States Passport Agency, included the processing of passport application. Passport applicants must submit sensitive...
-
Mary Beth Marrs, the manager of an apartment complex, feels overwhelmed by the number of complaints she is receiving. Below is the check sheet she has kept for the past 12 week. Develop a Pareto...
-
Transform the E-R model of project2 into a relational model. TransactionNo Date Hired Education Employee Address NumberOfItems Email 100 MemberD Name Transaction D Member TypeName Member Classify...
-
On March 1, 2017, Quinto Mining lnc. Issued a $560,000, 6%, three-year bond. Interest is payable semiannually beginning September 1, 2017. Required: Part 1 a. Calculate the bond issue price assuming...
-
III. Mariah Corp has the following non-trading equity securities 31, 2020: IV. Security ABC ordinary shares DEF ordinary shares GHI preference shares # of Shares 9,000 30,000 2,400 The following...
-
Say you know that the return on the S&P 500 will be 3 % next month and that the industry index next month will be 2. Forecast stock is return.
-
Suppose you are interested in how stock returns differ in different months of the year. You decide to use dummy variables to examine this difference. If you choose to use 12 dummy variables, what...
-
Consider a time series whose first value was recorded in December 1945. The last period for which there are records is June 1984. (a) How many full months of data are available? (b) How many full...
-
Suppose we are interested in the proportion of college seniors in a class of 900 who will be attending graduate school. A survey of 50 seniors reveals that 15 will be attending graduate school. We...
-
The number of cars licensed in a particular state last year was 4.8 million; the number of cars licensed in a neighboring state was 3.9 million. For the current year, the officials of the neighboring...
-
12. You have $10,000 in savings. Assume you earn 2.5% compounded quarterly on it for three years, then you earn 5% annually for the next two years, then you withdraw $1,000 to buy a new phone, then...
-
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...
-
What is likely to be the impact of rising levels of intra-regional trade for the world economy?
-
Why doesnt the USA specialise as much as General Motors or Texaco? Why doesnt the UK specialise as much as Unilever? Is the answer to these questions similar to the answer to the questions, Why...
-
It is often argued that if the market fails to develop infant industries, then this is an argument for government intervention, but not necessarily in the form of restricting imports. In what other...
Study smarter with the SolutionInn App