#include using namespace std; typedef long long LL; typedef double LD; typedef pair < int, int > PII; typedef pair < LL, LL > PLL; #define all(x) (x).begin(), (x).end() #define sz(x) (int)(x).size() LD a, b, r, a1, a2, b1, b2; LD steps = 1e8; LD calc(LD x) { LD val = r * r - (x - a) * (x - a); if(val <= 0) return 0; val = sqrt(val); LD y1 = -val + b, y2 = val + b; y1 = max(y1, b1); y2 = min(y2, b2); return y2 - y1; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> a >> b >> r >> a1 >> b1 >> a2 >> b2; if(a1 > a2) swap(a1, a2); if(b1 > b2) swap(b1, b2); LD c = (a2 - a1) / steps; LD last = calc(a1); LD ans = 0; for(LD x = a1 + c; x <= a2; x += c) { LD tmp = calc(x); ans += (tmp + last) * c / 2.0; last = tmp; } cout << fixed << setprecision(4) << ans << "\n"; return 0; }