Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define pb push_back
- #define mp make_pair
- #define F first
- #define S second
- #define pii pair <int, int>
- #define sz(a) (int)(a.size())
- #define resize(v) v.resize(unique(all(v)) - v.begin());
- #define all(a) a.begin(), a.end()
- #define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
- #define ld long double
- using namespace std;
- void Fast_Read_Out()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(), cout.tie();
- }
- void Random()
- {
- unsigned int seed;
- asm("rdtsc" : "=A" (seed));
- srand(seed);
- }
- unsigned int Time()
- {
- unsigned int time = clock() / 1000.00;
- return time;
- }
- const int inf = int(1e9) + 123;
- const ld eps = 1e-9;
- int t, a, b, c;
- int main ()
- {
- #ifdef JUDGE
- freopen("input.txt", "r", stdin);
- #endif
- Random();
- Fast_Read_Out();
- cin >> t;
- while(t--)
- {
- cin >> a >> b >> c;
- double l = 0, r = 1e9 + 1;
- while(abs(l - r) > eps)
- {
- double mid = (l + r) / 2;
- if(a * mid + b * sin(mid) > c) r = mid;
- else l = mid;
- }
- cout << fixed << setprecision(6) << l << endl;
- }
- #ifdef JUDGE
- // cout << Time() << endl;
- #endif
- }
- // Easy Peasy Lemon Squeezy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement