One Lap Around the Playground
InterviewTime limit1sMemory limit512 MB
Compute the perimeter of a track made of a rectangle between two semicircles, given the rectangle width and one semicircle radius, using pi = 3.141592.
- Level
Easy3 of 10
- Topics
- Math, Geometry, Implementation
- Solved
- No attempts yet
Problem
Se-yeon's school playground looks like the figure below.

In the figure, regions A and B are semicircles and region C is a rectangle. Given the width of region C as d1 and the radius of region A as d2, write a program that finds the perimeter of one lap around the playground. (In this problem, the value of π (pi) is 3.141592.)
Input
The first line gives the value of d1. The second line gives the value of d2. (d1 and d2 are positive integers no greater than 100,000.)
Output
On the first line, print the answer the problem asks for. An absolute or relative error of up to 10-6 is allowed.