<|instruction|>
Solve the below problem. The solution should start with an abridged problem statement. Then key observations. Then full solution based on the observations. Then C++ and Python implementations with comments.

417. Heavy Disc
Time limit per test: 0.5 second(s)
Memory limit: 262144 kilobytes
input: standard
output: standard



Consider a heavy disc on the plane, centered at (x0,y0) with radius r, with the origin strictly outside it. The density of the disc is given by formula

p(x,y) = ln(x^2+y^2)

What is the mass of the disc?

Input
The input file contains three integer numbers x0, y0, r (-100 ≤ x0, y0 ≤ 100, 1 ≤ r ≤ 100).

Output
Output one real number — the mass of the disc. Your answer will be considered correct if it is within 10-12 relative error of the exact answer.

Example(s)
sample input
sample output
3 4 2
40.449586576894895

<|response|>
1. Abridged Problem Statement  
   Given a disc of radius r centered at (x0, y0) on the plane, with the origin strictly outside the disc (i.e., sqrt(x0²+y0²) > r). The material density at a point (x,y) is p(x,y) = ln(x²+y²). Compute the total mass  
     M = ∬_{(x–x0)²+(y–y0)² ≤ r²} ln(x²+y²) dx dy  
   and output it with relative error up to 1e–12.

2. Key Observations  
   • Let s = sqrt(x0² + y0²). Since s > r, for any point in the disc the distance to the origin is never zero.  
   • Shift to polar coordinates (D, θ) around the disc’s center:  
       x = x0 + D cosθ,  
       y = y0 + D sinθ,  
       D ∈ [0, r], θ ∈ [0, 2π).  
     Then the area element dx dy = D dD dθ.  
   • In these coordinates, x² + y² = s² + D² + 2 s D cosθ.  
   • We need I(D) = ∫₀^{2π} ln(s² + D² + 2 s D cosθ) dθ. A standard result for A > |B| is  
       ∫₀^{2π} ln(A + B cosθ) dθ = 2π · ln((A + sqrt(A² – B²))/2).  
     Here A = s² + D², B = 2 s D, so sqrt(A² – B²) = s² – D² and  
       (A + sqrt(A² – B²))/2 = s².  
     Hence I(D) = 2π ln(s²), independent of D.

3. Full Solution Approach  
   1. Compute s² = x0² + y0².  
   2. Write the mass integral in shifted polar form:  
        M = ∫_{θ=0..2π} ∫_{D=0..r} D · ln(s² + D² + 2 s D cosθ) dD dθ.  
   3. Swap integrals and evaluate the θ–integral first using the formula above:  
        ∫₀^{2π} ln(s² + D² + 2 s D cosθ) dθ = 2π ln(s²).  
   4. Then  
        M = ∫₀^r D · [2π ln(s²)] dD  
          = 2π ln(s²) · ∫₀^r D dD  
          = 2π ln(s²) · (r²/2)  
          = π r² ln(s²).  
   5. Since ln(s²) = 2 ln(s), one may also write M = 2 π r² ln(s), but π r² ln(x0² + y0²) is simplest.  

   Final formula:  
     M = π · r² · ln(x0² + y0²)

4. C++ Implementation with Detailed Comments  
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    // Read input: center coordinates x0, y0 and radius r
    long long x0, y0;
    double r;
    cin >> x0 >> y0 >> r;

    // Compute squared distance from origin to center
    double s2 = double(x0)*x0 + double(y0)*y0;

    // Using the derived closed-form: M = π * r^2 * ln(s2)
    const double PI = acos(-1.0);
    double mass = PI * r * r * log(s2);

    // Output with high precision
    cout << fixed << setprecision(12) << mass << "\n";
    return 0;
}
```

5. Python Implementation with Detailed Comments  
```python
import math
import sys

def main():
    # Read three numbers from stdin: x0, y0, r
    data = sys.stdin.read().strip().split()
    x0, y0, r = map(int, data)

    # Squared distance from origin to the disc center
    s2 = x0*x0 + y0*y0

    # Closed-form result for the mass:
    #   M = π * r^2 * ln(s2)
    mass = math.pi * (r**2) * math.log(s2)

    # Print with 12 decimal places
    print("{:.12f}".format(mass))

if __name__ == "__main__":
    main()
```