We are given an example: Input:
2
10 10
Output: 40.00000000
We need to understand the problem. It's not explicitly stated. Possibly it's a problem from some contest.
Given the Input: first line is 2, maybe the number of test cases or number of sides? Second line: 10 10 maybe dimensions. Output is 40.00000000 which is perimeter of a rectangle? 10+10+10+10=40. So maybe it's to compute perimeter of a polygon? But the first line is 2: maybe number of points? 2 points? That would be a line segment, not a polygon. Or maybe it's number of sides of a regular polygon? Actually "2" could be number of sides? Then 10 10 could be length of each side? But with 2 sides it's not a polygon; maybe it's an n-sided polygon with side lengths? But why two numbers? Could be coordinates? Might be a problem to compute perimeter of convex hull given points? But example is too simple.
Let's think: Many geometry problems ask for perimeter of convex hull of given points. For instance: Input: first integer n (number of points). Then n lines each with x y coordinates. Compute perimeter of convex hull. For n=2, convex hull is line segment, perimeter is twice the distance? But usually perimeter of convex hull of two points is 2*distance (since hull would be a degenerate polygon? Actually for two points, convex hull is line segment; perimeter might be defined as length of hull? But typical convex hull perimeter for 2 points is 2 * distance? Let's recall: In many problems, if there are only two points, the convex hull is the segment, and its "perimeter" could be considered as 2 * distance between points? Actually no: The convex hull of two points is just the line segment connecting them; its boundary is the segment itself (twice? The segment has two endpoints but no area; the length of the hull is the distance. But in many problems, they require the length of the convex hull polygon, which for two points degenerates to twice the distance (if they consider the hull as a degenerate polygon where you go from one point to the other and back)? That doesn't make sense.
Alternatively, maybe it's a problem to compute the total distance between points in order? For n=2, the output is 40? With points (10,10) and something else? Actually there is only one pair after the 2. Could be that the input after n includes n lines each with two integers? But here it's just one line with two numbers after the 2. Could be that the input is: n (number of sides of a regular polygon) then side length? But 10 10 not side length. Could be radius? No.
Let's parse the example:
Input:
2
10 10
That's ambiguous. Possibly it's two test cases? No, first line is 2 maybe number of test cases, then for each test case there is a line with two numbers? But then we would expect two lines after, but there is only one line. So not that.
Maybe it's n=2 points, and each point has coordinates? But there is only one line with two numbers, not two lines. Could be that the points are given as one pair per line, but they are all in one line? Actually they wrote "2\n10 10\n". That would be two numbers: n=2, then coordinates of the two points: maybe first point is (10,10) and the second point is missing. Or maybe the points are provided as two numbers per point? Actually we need two points: maybe (10,10) and (10,10)? That would be same point, perimeter zero. Not 40.
Maybe the problem is to compute the circumference of an ellipse? But then inputs would be a and b? And first line is number of test cases? With one test case, n=2? Not clear.
Let's search memory: There is known problem "GCPC11J - Time to live" something else. Not.
Could be problem "UVA 10432 - Polygon Inside A Circle"? No.
Maybe it's from Codeforces? Possibly problem "A. The Last Problem"? No.
Given that output is 40.00000000, it's a nice round number. Could be perimeter of square with side 10? But input says 2,10 10. Could be that 2 is the number of vertices? If polygon with 2 vertices, that's degenerate, but maybe they intend to compute the perimeter of the bounding box? Not.
Let's think about other possibilities: Could be that the problem is to compute the length of fencing needed for a rectangular field, given length and width? But input format: first integer maybe number of test cases? Actually if first integer is 2, and then line "10 10", output 40, that could be: For each test case, read two integers a and b, compute perimeter = 2*(a+b). That would give 40. And the first line 2 is number of test cases? But then there is only one test case. Could be that they forgot to write second test case? But they provided example input and output; perhaps it's a minimal example: one test case. But why the 2? Could be that the first line is the number of input pairs? Actually maybe the problem description: "You are given n, and then n lines each containing two numbers a_i, b_i. Compute the perimeter of the polygon formed by connecting points (a_i, b_i) in order." That would be like perimeter of polygon given vertices. For n=2, polygon is a line segment? But we could treat as a degenerate polygon; perimeter would be distance between the two points? That would not be 40 for points (10,10) and something else. Unless the second point is (10,10) again? Not.
Maybe the input format is: first line: number of vertices n. Then next n lines: coordinates. Example:
2
10 10
10 10
But they mistakenly wrote only one line for coordinates? But they wrote "10 10" only once. Could be that they omitted the second coordinate line? Possibly the actual example is:
Input:
2
10 10
10 10
Output:
0.00000000
But that wouldn't be 40.
Maybe the problem is about computing the perimeter of a polygon after some operation. Or maybe it's about "A. Spongebob and the rectangle" type?
Another thought: The problem could be "Perimeter of a quadrilateral" given side lengths? For a quadrilateral, perimeter is sum of sides. If input is 2 and 10 10? Not.
Maybe the first number is the dimension? Like 2D? And then two numbers are side lengths of rectangle? But then why have the 2? Possibly it's the number of sides of a regular polygon? For a regular polygon with n sides of length s, perimeter = ns. For n=2, perimeter = 210 = 20, not 40. So no.
Could be the problem: "Given the number of vertices n and the coordinates of the vertices in order, compute the perimeter." That's a classic problem. For a rectangle of size 10x10, you'd need 4 vertices. If n=4, coordinates: (0,0), (10,0), (10,10), (0,10). That perimeter = 40. But input shows 2, not 4.
Maybe the first line is the number of test cases, and the next lines describe each test case starting with an integer m? Could be: first line = T (number of test cases). For each test case, first line is n (number of vertices), then n lines of coordinates. So the input could be:
2 // T=2? But then only one test case? Or T=1? Actually they wrote 2, then 10 10. Could be that T=1 and then they incorrectly wrote 2 as the n? But then 10 10 would be coordinates? That would be a polygon with 2 vertices: (10,10) and then the next line would be another coordinate, but not given. Not.
Maybe the problem is from Codeforces Round #146 (Div. 2) problem "A. LLPS"? No.
Let's search memory: I recall a problem "The Circumference of the Circle" or "Polygon Perimeter" from UVA. But not.
Alternatively, maybe the problem is about computing the perimeter of a polygon that is the convex hull of points, but the example is for n=2 points both at (10,10)? Not.
Wait, maybe the problem is "Find the perimeter of the polygon that is the intersection of two axis-aligned squares" or something. Not.
Given the output has 8 decimal places, it's likely a geometry problem requiring floating point output. And the input is integers (10,10). So it's something that yields integer perimeter.
Maybe it's "Perimeter of a rectangle" given its length and width. But why first number 2? Could be that the first number is the number of dimensions? Like 2D? Then next line is dimensions? That seems odd.
Maybe it's a problem: "Given the number of sides and the length of each side, compute the perimeter." But then input would be: first integer n, then n numbers side lengths. For n=2 and side lengths 10 and 10, perimeter = 20, not 40. Unless they consider it's a rectangle with sides 10 and 10, which has 4 sides, but they input 2 as the number of pairs? That doesn't add up.
Perhaps the input is: n (number of vertices) and then the coordinates of the vertices (x_i, y_i) separated by spaces, all on one line? That would be: 2 means two vertices, then the next line contains 4 numbers: x1 y1 x2 y2? But they only gave two numbers. Could be: For n=2, the line "10 10" could be the coordinates of both points? That doesn't work.
Alternatively, maybe the problem is "Given the radius of a circle, compute its circumference" but then output would be 2pi10 ≈ 62.83, not 40.
Maybe it's "Given the area of a square, compute perimeter." If area=10? But output 40? Actually area 10 gives side sqrt(10)≈3.16, perimeter≈12.65. Not.
Maybe it's "Given the coordinates of two opposite corners of a rectangle, compute its perimeter." If corners are (0,0) and (10,10), then rectangle sides 10 and 10, perimeter 40. Input: first line: number of points? Actually they might input 2 for two points, then two lines: each with coordinates. But they've only printed one line. In the example, they might have condensed it:
2
10 10
0 0
But they only showed one line? Or they showed 10 10 as both lines? Not.
If the input is:
2
0 0
10 10
Then output could be 40 if they compute perimeter of rectangle with those as opposite corners? That rectangle would have width=10, height=10, perimeter=40. So that makes sense: The first line is number of points, then each point on a separate line. Example shows "10 10" but maybe they omitted the first point? Actually if the example is:
Input:
2
0 0
10 10
Output:
40.00000000
That would be a perfect example: For two points (0,0) and (10,10), the rectangle formed by them with sides parallel to axes? But if we assume rectangle with opposite corners (0,0) and (10,10), the perimeter is 40. However, that is too trivial for a problem: just compute 2*(|x2-x1|+|y2-y1|). But many problems are simple.
But why would they need to output with 8 decimal places? Because in more general case, points may be arbitrary, and the perimeter could be of the bounding box? Actually if you have two points, the rectangle with them as opposite corners is axis-aligned? Could be they want the perimeter of the rectangle with sides parallel to axes given the coordinates of opposite corners. That's simple.
But the example as shown in the prompt is only "2\n10 10\n". That seems incomplete. Possibly the problem statement originally had multiple test cases, and the example input includes two test cases: first line 2 indicates number of test cases, then each test case consists of two numbers? That would be: T=2, then for each test case, two numbers a and b? But then we need two lines after: e.g., "10 10" for first test case, and maybe second test case missing. Or maybe they intended to show only one test case but put 2 as the number? That doesn't fit.
Alternatively, maybe it's a problem about "Walking around a polygon" given steps? Not.
Let's look at the format: "Example\nInput\n\n2\n10 10\n\nOutput\n\n40.00000000". Usually in many competitive programming problem statements, they present the example input and output exactly as expected. So the example input has two lines: the first line contains the integer "2", the second line contains "10 10". That's it. So the input is two lines. So the problem likely expects exactly that. So what does "2" represent? Possibly it's the number of sides of a shape? And "10 10" are two side lengths? Then perimeter would be 2*(10+10)=40. Actually 2 * (10+10) = 40. That is plausible: if the shape is a rectangle, perimeter = 2*(length+width). But then why would the first number be 2? It could be the number of dimensions? Or maybe it's the number of sides that are equal? Like if it's a square, but then you only need one side length. Or if it's a rectangle, you need two sides. And the first number might indicate the number of side lengths that follow? That would be: first integer n (number of side lengths), then n numbers (the side lengths). For a rectangle, you have two different side lengths? But a rectangle has 4 sides, but two pairs equal. So you could represent it by two distinct side lengths. Perimeter = 2*(a+b). So if n=2, and the side lengths are 10 and 10, then perimeter = 2*(10+10)=40. That matches.
So the problem could be: "Given the number of sides of a polygon that is a 'regular'? Actually not regular, but maybe it's a 'kite'? No.
But if it's just any polygon with n sides given side lengths, perimeter is sum of sides. However, for n=2, sum would be 20. So that doesn't match. Unless they consider that the polygon is a rectangle and the two numbers are length and width, not side lengths per se. So the first line is not number of sides; it's maybe the number of dimensions? Actually rectangle has 2 dimensions: length and width. So input: first integer: dimension? Then two numbers: the length and width? Then output perimeter: 2*(l+w). That yields 40. That seems too trivial for a programming problem.
Maybe it's a problem about "Polygon Perimeter" where polygon is defined by its vertices. The first line is n, the number of vertices. Then n lines follow with x y coordinates. The perimeter is sum of distances between consecutive vertices (including last to first). For a rectangle with vertices (0,0), (10,0), (10,10), (0,10), n=4. But we have n=2. So not.
Maybe the problem is about the perimeter of an ellipse: given a and b? That would be more complex and output not integer for 10,10? Actually if a=b=10, it's a circle, circumference = 2pi10 ≈ 62.83185307, not 40.
Maybe it's about the perimeter of a right triangle? Given legs 10 and 10, hypotenuse = 10*sqrt2 ≈14.1421, perimeter≈34.1421. Not 40.
Maybe it's about the perimeter of a rhombus? Not.
Given the simplicity, maybe it's an introductory problem: "Calculate the perimeter of a rectangle" but then why would the first input be 2? Could be that the problem is to read two integers a and b and output 2*(a+b) with 8 decimal places. But then why show the "2" on its own line? Could be a formatting error: maybe the problem originally had the number of test cases first, then each test case has two integers. For example, the problem might be: "Given the length and width of a rectangle, compute its perimeter." But they also include the number of test cases. Usually they'd have T on first line, then T lines each with two integers. The example would then have T=2, but then only one test case? That doesn't match; they'd need two test cases.
Maybe the problem is "Given the number of rectangles and their dimensions, compute the total perimeter?" Not.
Let's search memory: There is a problem on CodeChef named "RECTPERI" (Rectangle Perimeter). The input format: first line T number of test cases, each test case line contains two integers L and W. Output the perimeter. Example: Input: 2\n1 1\n2 3\n Output: 4\n10. But that would be multiple lines. In that example, they'd show something like:
Input:
2
1 1
2 3
Output:
4
10
But here we have only one output line: 40.00000000.
Maybe it's from Hackerrank "Calculate the perimeter of a rectangle" but they ask for two integers on one line? Usually the problem would just read two integers from input. They might not have a test count.
Maybe the problem is "UVA 1556 - Disk Tree"? No.
Let's think differently: The example shows "2" on first line, then "10 10". Could be that 2 is the number of points, and the next line "10 10" is the coordinates of the first point, and there is an implied second point at (0,0) or something? But then why would they not show it? Unless the problem expects that the polygon is defined by points relative to origin? For example, if there are n points, the first point is given, and the rest are computed by some rule? Like generating a regular polygon? For n=2, it's a line through origin? Not.
Another possibility: The problem is to compute the perimeter of a polygon that is the convex hull of a set of points. Input: first line n (number of points). Then n lines each x y. The output is perimeter of convex hull. For two points, convex hull is a line segment. Some might treat perimeter as 0? Or maybe they consider the distance traveled around the hull, which for two collinear points is the twice the distance (like you go from one point to the other and back). That would give 2*distance. If the points are (0,0) and (10,10), distance=14.1421, *2=28.2843, not 40. So no.
Perhaps it's about the perimeter of a shape made by joining points in order, but the example only shows 2 points. That seems odd.
Could the problem be about "UVA 218 - Moth Eradication"? That's convex hull and perimeter. The example there might be with 2 points? Not.
Maybe the problem is from an online judge where they often have "Perimeter of a Polygon" problem: Input: The first line contains N, number of vertices. Each of the next N lines contains the coordinates of a vertex. Compute the perimeter. For a rectangle, you'd need 4 vertices. So the example would be N=4. But here N=2.
Could it be that the polygon is defined by its side lengths and angles? No.
Let's look at the output formatting: 40.00000000 (8 decimal places). That suggests that the answer is a double with high precision. Many geometry problems require printing perimeter of polygon given coordinates, often with distance computations that yield floating point. For a rectangle with side 10, perimeter is 40 exactly, but they still output with decimals. So that's consistent.
Given the difficulty in deducing, maybe the original problem description is missing. The user gave only "Example Input ... Output ...". They want us to figure out what problem it is? Possibly they want us to write a solution to a problem based on the example. Without context, we need to infer.
Maybe it's from a problem "Rectangle Perimeter" on some judge. But the presence of "2" as first line could be the number of test cases, but they only gave one case. Could it be that the example is incomplete? Possibly they truncated the input: maybe the actual input is:
2
10 10
20 20
Output:
40.00000000
80.00000000
But they only showed the first output? But they'd show two outputs. The output shows only one line.
Could be that the problem is: "Given a number n and then n numbers, compute the perimeter of the polygon that can be formed with these side lengths." But that would be sum. For 2 and 10,10, sum=20, not 40. Unless they consider the polygon is a regular polygon? Not.
Perhaps the problem is: "Given the radius of a circle inscribed in a square, find perimeter of the square." If radius=10? Actually inscribed circle in a square: the circle touches all sides, so diameter = side length. So if radius=10, side=20, perimeter=80. Not 40.
Maybe the problem is: "Given the diagonal of a square, find its perimeter." For diagonal=10, side=10/√2≈7.07, perimeter≈28.28. Not 40.
Maybe it's: "Given the area of a square, perimeter = 4*√(area). For area=100, perimeter=40. That matches! If the input is: first line is number of test cases? Or maybe it's just the area? But they have two numbers: 10 10. Could be that they represent length and width of rectangle? Area=100? Actually 10*10=100. Then perimeter=40. So it could be: Input: two numbers representing sides of a rectangle; output perimeter. But again the first line 2 is unexplained.
Maybe the problem: "Given the lengths of the two sides of a rectangle, compute its perimeter." Then the input would be two numbers separated by space. But they have an extra "2" line. Possibly the problem description originally had "The first line contains an integer T, the number of test cases. Each test case consists of two integers a and b on a line." But the example T=2, then the next two lines are test cases? But they only gave one line. Could be they only showed one test case for brevity? However, typical example would show both test cases.
Maybe it's: "Input: The first line contains N (1 ≤ N ≤ 100). The next line contains two integers L and W." That would be weird.
Maybe it's from a problem about "Coconut" something.
Let's search memory: There's a problem on CodeChef called "PERIMETER" maybe? Not.
Maybe the problem is "UVA 10432 - Polygon Inside A Circle" where you compute area of polygon inscribed in circle. Not.
Maybe the problem is "UVA 11639 - Guard the Land"? Not.
I think the most plausible explanation is that the problem is simply to compute the perimeter of a rectangle given its length and width. The first line might be the number of test cases, and the example only shows one test case for brevity but included the "2" to indicate the number of test cases is 2? But then they'd need to show output for two test cases. However, sometimes in problem statements, they provide an example where the first line is the number of test cases, but they only show one test case input and the corresponding output for that test case, while omitting the rest. That could be the case: they wrote "2" meaning two test cases, then the first test case is "10 10", and the output for that test case is "40.00000000". But then they'd typically show both outputs on separate lines. Unless the problem expects to output each result on its own line, and they only show the first one? Not typical.
Alternatively, maybe the problem is "Given the coordinates of two opposite corners of a rectangle, compute the perimeter." Input: first line integer n (number of rectangles?), then for each rectangle two lines? Not.
Given the limited information, I'm leaning that the problem is to compute the perimeter of a polygon defined by its vertices. The example would then need four vertices. But they've given 2. Could it be that the polygon is a regular polygon with n sides and side length s? Then perimeter = n*s. For n=2, s=10, perimeter=20. Not 40. For n=4, s=10, perimeter=40. So if they accidentally wrote 2 instead of 4? Possibly a typo.
Maybe the problem is "UVA 1230 - MODEX" no.
Let's approach from reverse: The output is 40.00000000. What are simple operations that yield 40 from inputs 2 and 10,10? Possibilities:
- 2*(10+10)=40
- 4*10=40 (if 2 is ignored or indicates something else)
- 210+210=40 (same)
- (10+10)*2=40
- 10*4=40 if second 10 is something else.
- sqrt(10^2+10^2)*? Not.
If we ignore the first 2, then input is 10 10, output 40, which is 2*(10+10). So maybe the first 2 is actually the number of input values (2) and the values are 10 and 10. But then why write it separately? Some input formats start with the number of values to read. For example: "The first line contains an integer N, the number of side lengths. The second line contains N integers." Then N=2, and the two integers are 10 and 10. Then the perimeter of the rectangle with these as adjacent sides? But then perimeter is 2*(10+10). That fits: N=2, sides: 10 10 -> perimeter = 2*(a+b). Yes! That makes sense. The problem: "You are given N side lengths of a rectangle. Compute its perimeter." But a rectangle has two unique side lengths, but you could be given N=2 numbers representing length and width. So perimeter = 2*(a+b). For a square (a=b), it's 4a which equals 2*(a+a)=4a. So output is 40. That matches.
But is that a typical problem? Usually they'd just ask for rectangle perimeter, and they'd just give two integers L and W. They wouldn't need N because you always have exactly two numbers. However, sometimes problems are structured with a variable number of inputs; for a rectangle you'd need exactly 2, but they still include N for consistency. For example, if the problem is part of a set where sometimes they give triangles, quadrilaterals, etc. Maybe it's "Given the number of sides and the side lengths, compute the perimeter of the polygon." But for a polygon with N sides, perimeter = sum of side lengths. For N=2, sum=20. So not.
So the only way to get 40 from two side lengths 10 and 10 with an N=2 is if the shape is a rectangle (implying the side lengths are the lengths of adjacent sides, and there are 4 sides in total, two each). But then the number of inputs N=2 corresponds to the number of distinct side lengths, not the number of sides. That would be unusual.
Maybe the problem is: "Given the length and width of a rectangle, output its perimeter." But they include the number of test cases, and the example only shows one test case, but they accidentally wrote 2 as the number of test cases? Could be the example is:
Input:
2
10 10
20 20
Output:
40.00000000
80.00000000
But they only wrote the first output? Unlikely.
Maybe the problem is from SPOJ "PERIMETER" (maybe a problem about perimeter of a binary image). Not.
Given that the user only provided the example, they likely want us to guess the problem and write a solution. Since I'm ChatGPT, I need to produce a solution that reads input in the given format and outputs a perimeter of 40 for that input. The simplest guess is: The first line contains an integer n, the number of points? Or maybe the first line is the number of sides of a polygon? But we need to produce something that yields 40 for input "2\n10 10\n". We need to decide what computation to perform.
Let's think about possible problems that have exactly this input/output. Perhaps it's a problem about "the length of the fence needed to enclose a rectangular garden" where the input is: first line: number of sides (always 4) but they might ask for number of test cases? No.
Wait, maybe the problem is "UVA 11455 - Behold my quadrangle". That problem: Given four side lengths, determine if they can form a quadrilateral, square, rectangle, etc. The output is "quadrilateral", "square", "rectangle", "banana". But not perimeter.
Another problem: "UVA 12289 - One-Two-Three". Not.
Could it be "UVA 10078 - Art Gallery"? Not.
Maybe it's from Codeforces Round #112 (Div. 2) problem "A. Super Agent"? Not.
Let's look up mental memory: There's a problem on Codeforces "A. The number of positions" no.
Maybe it's from AtCoder beginner contest: "ABC 052 A - Two Rectangles"? That involves area, not perimeter.
Given the time, perhaps I should just assume the problem is to compute the perimeter of a rectangle with given length and width, and the first line is just the number of test cases, but in the example they only show one test case, but maybe they want to output for each test case. But we only have one line of output. Alternatively, the first line could be an integer that we ignore (maybe it's the number of dimensions, which is 2 for 2D). Then we read two numbers a and b, and compute perimeter = 2*(a+b). That would produce 40. The output is formatted with 8 decimal places, so we need to print as floating point.
Thus, a plausible solution: read an integer n from the first line (which might be 2), then read two doubles a and b from the next line. Compute perimeter = 2 * (a + b). Print with 8 decimal places.
But why would we read n if it's always 2? Could be that the problem originally said: "The first line contains the number of dimensions D (2 ≤ D ≤ 10). The second line contains D integers representing the side lengths of a hyper-rectangle. Compute its perimeter." In 2D, perimeter = 2*(a+b). In 3D, the perimeter (surface area?) Not. The perimeter is a 2D concept; in higher dimensions it's not defined.
Maybe it's the perimeter of a "D-dimensional box"? Actually the sum of edges of a D-dimensional box? For a D-dimensional rectangular prism, the total length of all edges is 2^{D-1} * sum of side lengths? No, the number of edges in a D-dimensional hyperrectangle is D2^{D-1}? Actually each dimension contributes 2 edges for each combination of other dimensions? The total edge length = sum over each dimension (side length in that dimension times number of edges parallel to that dimension). In a D-dimensional orthogonal parallelepiped, the number of edges parallel to a given dimension is 2^{D-1}. So total edge length = sum_{i=1}^{D} (a_i * 2^{D-1}) = 2^{D-1} * sum a_i. For D=2, total edge length = 2^{1} * (a+b) = 2(a+b) = perimeter. For D=3, total edge length = 2^{2} * (a+b+c) = 4(a+b+c). That is not the surface area, but the sum of all edge lengths. Could be a problem: "Given dimension D and side lengths, compute the total length of all edges." Then input: first line D, second line D numbers. Output total edge length. For D=2, a=10,b=10 => total edge length = 2*(10+10)=40. That fits perfectly! And the output with 8 decimals is fine. For D=3, with sides 10,10,10 => total edge length = 4*30=120. This is a plausible problem: computing the total length of edges of a hyperrectangle (also called the "total edge length" or "sum of edges" of a D-dimensional box). The problem might be titled "Hyperrectangle Edge Length" or "Edge Sum". In many programming contests, there is a problem like "Dice" but not.
This is a neat generalization. The first line is the dimension D (2 in the example), and the second line contains D positive integers (side lengths). Compute the sum of lengths of all edges. Since a hyperrectangle in D dimensions has edges: for each dimension i, there are 2^{D-1} edges parallel to that dimension, each of length a_i. So total length = 2^{D-1} * (a_1 + a_2 + ... + a_D). This yields 40 for D=2, a=[10,10] because 2^{1}*(20)=40. That matches.
Given the example, this is a very good fit. Also, the output is formatted with 8 decimal places, which is a bit overkill for integers, but maybe they want floating point because the side lengths could be floating point? But in the example, they are integers. The problem could allow real numbers. So we need to compute total edge length = (2^{D-1}) * sum_i a_i. But careful: For D=1, what would be? But maybe D≥2. Anyway.
Thus, the problem likely is: "Given the dimension D and the side lengths of a D-dimensional hyperrectangle, compute the sum of the lengths of all its edges." That is a known problem? I recall a problem from Codeforces: "630A Again Twenty Five!" no. Not that.
I also recall a problem from UVA: "UVA 12155 - ASCII Diamondi" no.
But I'm convinced that this is a plausible interpretation.
Let's verify with more reasoning: The input "2\n10 10\n" yields 40. If D=2, sum of sides = 20, times 2^{1}=2 => 40. Perfect. If D=3 and sides 10 10 10, output would be 4*30=120. That seems plausible.
Moreover, the problem would be trivial for D=2 but interesting for higher D. It would require reading an integer D, then D numbers, compute 2^{D-1} * sum, print with 8 decimal places. That is straightforward, but might be a bit too trivial. But many online judges have such simple problems.
The output with 8 decimal places suggests they want high precision, maybe because D can be large, 2^{D-1} can be huge, but sum of sides might be large too, but they can be stored in double. However, they might want to output in fixed-point with 8 decimals, even if result is integer, they'd still output .00000000.
Thus, I'll assume that's the problem.
But is there any alternative that also fits? Another possibility: The first line is number of points, and the second line is the coordinates of a single point? That doesn't.
Alternatively, maybe the problem is: "Given the number of test cases T (first line), for each test case, read two integers a and b, output perimeter = 2*(a+b) with 8 decimal places." But then they'd need T lines of output. The example would have T=2, so they'd show two outputs. But they show one. So perhaps they only displayed the first output for brevity, but they wrote "Output\n\n40.00000000". Could be that they only gave the output for the first test case and omitted the second. But usually examples show complete input and output.
Given the above, the hyperrectangle edge sum interpretation fits exactly with the provided input and output.
I'll search my memory: There is a problem on Codeforces called "630A - Again Twenty Five!" which is about last two digits of 5^n. Not. There is also "8A - Train and Peter" no. I'm trying to recall if any problem had such input format: first line D, second line D numbers. I recall a problem "A. Vanya and Cubes" no. There is "A. Fox And Snake" no. There is "A. Soft Drinking" no. There is "A. Die Roll" no. There is "A. Young Physicist" where you read n then n lines of three numbers. That's similar but not.
Maybe it's from Codeforces Round #164 (Div. 2) "A. Games" no.
Actually, there is a known problem "HYPERTRI - Hyperjump" no.
I recall a problem on SPOJ called "RECTME - Sum of sides" but I'm not sure.
Given the absence of other clues, I'll adopt the hyperrectangle edge sum problem.
Thus, the solution: read integer D from stdin. Then read D numbers (could be integers or floats) from the next line (or possibly from additional lines; but the example has them on one line). Compute sum = sum of the D numbers. Compute multiplier = 2^(D-1). Multiply sum by multiplier. Print result with 8 decimal places.
But careful: The input might have the D numbers on D lines? The example shows them on one line: "10 10". Since D=2, it's natural to have them on one line. But for larger D, they could be on one line or multiple. Typically, they'd be on one line. So we can read them all from the second line (or if not enough, from subsequent lines). We'll read tokens.
Implementation in C++: read D, then read D numbers (can use loop). Compute sum as double, multiplier = pow(2, D-1). Output using fixed and setprecision(8).
But note: D could be up to maybe 10 or 15? pow(2, D-1) is integer up to 2^something. We can compute as 1LL << (D-1) if D-1 < 64. But if D is large, like 10^5? That would be huge. But side lengths might be real numbers. But likely D is small (<=10) because hyperrectangle dimensions usually small. But not sure. To be safe, we can compute multiplier as (double)(1 << (D-1)) if D <= 63, else use pow. But if D is huge, 2^(D-1) will overflow. However, problem constraints probably keep D moderate. I'll assume D <= 30 maybe. But to be safe, use pow(2.0, D-1) which yields a double; may lose precision for large exponent, but that's okay as we output with 8 decimal places, and if D is large, the result might be huge and maybe they want exponential notation? But they want fixed 8 decimal places, so it must be within manageable range. So D is likely small.
Thus, the solution is straightforward.
However, before finalizing, let's consider if there is any other interpretation that yields the same. Could be that the problem is "Given the radius of a circle inscribed in a square, find the perimeter of the square." That would be: if radius r, side = 2r, perimeter = 8r. For r=5? Not 10. Not.
Maybe it's "Given the side length of a square, output perimeter." That would be 4*10=40. Then input: first line maybe number of test cases? But they gave "2"? Could be that the first line is the number of squares? Not.
Maybe it's "Given the number of sides of a regular polygon and the side length, output perimeter." Then for n=4, s=10, output 40. But they gave n=2. So if they mistakenly wrote 2, but meant 4, then it's that. But we can't rely on mistakes.
Could the problem be about computing the perimeter of a polygon with vertices at (0,0), (10,0), (10,10), (0,10)? That would require 4 points. The input might be just the side length? Not.
Another possibility: "Given the number of points n, and then n points, compute the perimeter of the convex hull." For two points, the convex hull length is 0? Or if they consider the distance traveled around the hull: maybe it's the distance between the two points multiplied by 2? That would be 2dist = 2sqrt(10^2+10^2) = 28.284, not 40.
Thus, the hyperrectangle edge sum is the most satisfying.
I'll search for known problems with this description: There's a problem on Codeforces named "1506A - Strange Table" not. "1660A - Vasya and Coins" no.
I recall a problem "A. I Wanna Be the Guy" no.
Maybe it's from AtCoder "ABC 259 A - Growth Record" no.
Let's consider the name "Example" - perhaps it's from a problem that simply says "Input: The first line contains an integer T (1 ≤ T ≤ 100) denoting the number of test cases. Each test case consists of two integers a and b (1 ≤ a,b ≤ 100). Output the perimeter of the rectangle with sides a and b." The example would then have T=2, but they'd show two test cases and two outputs. But they only show one output line. Possibly they only gave the output for the first test case and omitted the rest for brevity? Could be they wrote:
Input:
2
10 10
20 20
Output:
40.00000000
80.00000000
But the user only copied the first output. But then they'd have written two outputs. Since they didn't, it's less likely.
Given the user wrote "Example\nInput\n\n2\n10 10\n\nOutput\n\n40.00000000", it's probably exactly as displayed.
Thus, I'll go with the hyperrectangle edge sum.
Now, to produce the final answer: I'll write a solution in C++ that reads an integer D, then D floating point numbers (could be double), computes sum, multiplies by pow(2, D-1), and prints with fixed and setprecision(8). Also handle reading numbers from possibly multiple lines.
But there is nuance: The input might have D numbers on the same line as D? Actually the first line is D, second line contains D numbers separated by spaces. That's typical. However, some problems might have each number on a separate line. For D=2, it's fine. For generality, we can read tokens using while until we have D numbers.
I'll implement:
#include <bits/stdc++.h>
using namespace std;
int main() {
int D;
cin >> D;
double sum = 0.0;
for (int i = 0; i < D; i++) {
double x;
cin >> x;
sum += x;
}
double multiplier = pow(2.0, D-1);
double result = sum * multiplier;
cout << fixed << setprecision(8) << result << endl;
return 0;
}
That should work.
But we need to ensure that we don't overflow with pow if D is large? D likely small.
Alternatively, we can compute multiplier as (1LL << (D-1)) if D <= 62, else we could use pow. But I'll stick with pow.
Now, maybe the side lengths are integers, but we output with decimals. That's fine.
Thus, I'll output this as the solution.
But wait: Could there be multiple test cases? The problem statement might include multiple test cases, but the example doesn't show multiple. If it's hyperrectangle, typically there is just one case. But sometimes there are multiple cases, with first line being number of test cases. But then the example would have that many. However, the example shows first line 2, and then one line of numbers, and output one number. That is exactly what we expect if the first line is D, not T.
Thus, I'm confident.
I'll now produce a final answer with the solution code and explanation. ```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
// Read the dimension D
int D;
cin >> D;
// Read the D side lengths and compute their sum
double sum = 0.0;
for (int i = 0; i < D; ++i) {
double x;
cin >> x;
sum += x;
}
// Total edge length = 2^(D-1) * sum
double multiplier = pow(2.0, D - 1);
double ans = sum * multiplier;
// Output with exactly 8 decimal places
cout << fixed << setprecision(8) << ans << endl;
return 0;
}