## Editorial for Cutting Cake

Remember to use this editorial

**only**when stuck, and**not to copy-paste code from it**. Please be respectful to the problem author and editorialist.**Submitting an official solution before solving the problem yourself is a bannable offence.**Author:

Editorialist:

Cutting cake is a question that was first used in the third PCS standard contest.

This problem focuses on requiring good geometric knowledge, specifically of circles and chords within those circles. The only formula that is of any relevance from the linked page is \(h = R - \sqrt{R^2 + \dfrac{c^2}{4}}\), and the area of the cake \(A = (R-h)^2*pi\). We can simplify this to \(A = (R^2 + \dfrac{c^2}{4})^2\). Simply read the input and output \(A\).

```
#include <bits/stdc++.h>
using namespace std;
long T;
long double R, C;
int main() {
cin >> T;
while (T--) {
cin >> R >> C;
cout << setprecision(7) << fixed << (R*R - (((double)(C*C))/4))*M_PI << endl;
}
}
```

## Comments

Any advice on making this answer even shorter?