Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Bismillahir-Rahmanir-Rahim
- #include <bits/stdc++.h>
- using namespace std;
- #define flash ios_base::sync_with_stdio(0),cin.tie(0)
- #define pb push_back
- #define ll long long
- #define ld long double
- #define dbg(x) cerr << #x << " = " << x << "\n";
- #define ff first
- #define ss second
- /*
- #pragma GCC target ("avx2")
- #pragma GCC optimization ("O3")
- #pragma comment (linker, "/stack:200000000")
- #pragma GCC optimize("Ofast")
- #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
- */
- const long long INF = 1e9 + 7;
- const long long MOD = 1e9 + 7;
- const int maxn = 1e5 + 10;
- ld A, B, R, ans, x1, y;
- void press_F_() {
- cin >> A >> B >> R;
- for (ld x = 0; x * x <= R * R; x += 0.00001) {
- if (A * x + B * sqrt(R * R - x * x) > ans) {
- x1 = x;
- y = sqrt(R * R - x * x);
- ans = A * x + B * sqrt(R * R - x * x);
- }
- }
- cout << fixed << setprecision(5);
- cout << ans << '\n';
- cout << fixed << setprecision(5);
- cout << x1 << " ";
- cout << fixed << setprecision(5);
- cout << y;
- }
- int main() {
- flash;
- int T = 1;
- // cin >> T;
- for (int i = 1; i <= T; i++) {
- // cout << "Case" << " " << i << ':' << "\n";
- press_F_();
- }
- //Respa gold 2023-2024 InshAllah
- return 0;
- }
- /*
- Maybe not today and tomorrow, but InshAllah one day I will reach expert
- */
- // g++ -std=c++17 main.cpp
- // ./a.out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement