Problem Statement
You are standing at the centroid of an equilateral triangle of side length L. Your goal is to touch all three sides of the triangle and return back to the centroid.
You are given the int L. Compute and return the smallest total distance you need to travel.
Definition
- Class:
- ConfusingTriangle
- Method:
- findMinimum
- Parameters:
- int
- Returns:
- double
- Method signature:
- double findMinimum(int L)
- (be sure your method is public)
Notes
- Your return value is correct if it has an absolute or a relative error smaller than 10^(-9).
- Visiting a corner of the triangle counts as touching both sides that meet in that corner.
Constraints
- L will be between 1 and 106, inclusive.
Examples
No public sample cases were explicitly marked for this problem in the original data.