LCC '25 Contest 2 J3 - Rice Farming

View as PDF

Submit solution

Points: 5
Time limit: 0.6s
Memory limit: 64M

Author:
Problem type

Farmer John is standing in a rice field. He has a sunhat of radius K, and any crops underneath the hat instantly die due to its sheer effectiveness. He walks around along in a circle along the circumference with radius N. What is the area of crops that die?

Constraints

1 \leq K,N \leq 10^6

Input Specifications

The first and only line will contain space-separated integers K,N.

Output Specifications

Output the area of crops that die. Any answer within 10^{-6} will be considered correct.

Sample Input

3 5

Sample Output

188.495559215

Explanation for Sample Output

The region in which the crops die is \pi(8^2-2^2) = 60\pi and is shaded below. The blue region is the crops that die, and red is the hat size, and the middle circle is the path that farmer John walks along.


Comments

There are no comments at the moment.