Submission #1275818
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);
template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
EACH(x,vec) is >> x;
return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
REP(i,vec.size()) {
if (i) os << " ";
os << vec[i];
}
return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
REP(i,vec.size()) {
if (i) os << endl;
os << vec[i];
}
return os;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll T; cin >> T;
cout << fixed << setprecision(10);
while ( T-- ) {
ll h, w; cin >> h >> w;
if (h > w) swap(w, h);
assert(w >= h);
double ans = h;
chmax(ans, min(sqrt(h*h + w*w/4.), double(w)));
cout << ans << endl;
// double l = 0, r = 1e9;
}
}
Submission Info
Submission Time |
|
Task |
E - マッサージチェア2015 |
User |
drafear |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1746 Byte |
Status |
WA |
Exec Time |
5 ms |
Memory |
256 KB |
Judge Result
Set Name |
All |
Score / Max Score |
0 / 200 |
Status |
|
Set Name |
Test Cases |
All |
00_sample.txt, 10_squares.txt, 11_maxw.txt, 12_maxh.txt, 20_corner.txt, 21_corner.txt, 22_corner.txt, 23_corner.txt, 24_corner.txt, 30_small.txt, 40_random.txt, 41_random.txt, 42_random.txt, 50_corner.txt, 51_corner.txt, 52_corner.txt |
Case Name |
Status |
Exec Time |
Memory |
00_sample.txt |
WA |
1 ms |
256 KB |
10_squares.txt |
WA |
4 ms |
256 KB |
11_maxw.txt |
WA |
5 ms |
256 KB |
12_maxh.txt |
WA |
5 ms |
256 KB |
20_corner.txt |
WA |
5 ms |
256 KB |
21_corner.txt |
WA |
5 ms |
256 KB |
22_corner.txt |
WA |
5 ms |
256 KB |
23_corner.txt |
WA |
4 ms |
256 KB |
24_corner.txt |
WA |
5 ms |
256 KB |
30_small.txt |
WA |
4 ms |
256 KB |
40_random.txt |
WA |
5 ms |
256 KB |
41_random.txt |
WA |
4 ms |
256 KB |
42_random.txt |
WA |
4 ms |
256 KB |
50_corner.txt |
WA |
5 ms |
256 KB |
51_corner.txt |
WA |
4 ms |
256 KB |
52_corner.txt |
WA |
4 ms |
256 KB |