Circles in a Dish
Time limit1sMemory limit512 MB
Find a squared minus b squared for two concentric circles given T, the chord length where a tangent to the inner circle meets the outer one.
- Level
Medium7 of 10
- Topics
- Math, Geometry, Implementation
- Solved
- No attempts yet
Problem
A dish has the shape of two concentric circles, as shown in the figure below.

Let T be the distance between the two points where a tangent to the smaller circle meets the larger circle, b the radius of the smaller circle, and a the radius of the larger circle. Given the value of T, write a program that finds the value of a2-b2.
Input
The first line gives the value of the positive integer T. Here T is at most 10,000.
Output
Print the value of a2-b2 rounded to the nearest integer, rounding at the first decimal place. For example, if the value of a2-b2 is 1.91, print 2.