Problem:
The Farthest Point
Anant is on one of the vertices, say the
starting
vertex, of a rectangular cuboid (a hexahedron with all of its faces being rectangular). The surface of the cuboid constitutes the entire world of the ant.
We’d like to know which point on the surface of the cuboid is the farthest for the ant from the starting vertex. You may think that the
opposite
vertex, that is, the opposite end of the interior diagonal from the starting vertex, is the farthest. The opposite vertex is, however, not necessarily the farthest.
For example, on the surface of a cuboid of size $1 \times 1 \times 2$, the distance from a vertex to the opposite vertex is the square root of 8. The distance to the farthest point is, however, the square root of 65/8 (Figure F.1).
Figure F.1. Rectangular cuboid of size 1 × 1 × 2, and its net
You are given the size of the rectangular cuboid. Write a program which calculates the distance from the starting vertex to the farthest point.
Input
The input consists of a single test case of the following format.
$a$ $b$ $c$
The three integers $a$, $b$, and $c$ mean that the size of the rectangular cuboid is $a \times b \times c$. All of them are between 1 and 100, inclusive.
Output
Output a line containing the distance from the starting vertex to the farthest point. The relative error of the output must be less than or equal to $10^{−9}$.
Sample Input 1
1 1 2
Sample Output 1
2.850438562747845
Sample Input 2
10 10 10
Sample Output 2
22.360679774997898
Sample Input 3
100 2 3
Sample Output 3
101.0503923792481
Sample Input 4
2 3 5
Sample Output 4
7.093659140387279
Sample Input 5
84 41 51
Sample Output 5
124.582755157578

Submitted solutions:

code_snippet: #include<bits/stdc++.h>
using namespace std;
bool chmin(auto &a, auto b){ return a > b ? a = b, 1 : 0; }
bool chmax(auto &a, auto b){ return a < b ? a = b, 1 : 0; }
using ld = long double;
using vec = complex<ld>;

ld dist(ld a, ld b, ld c, ld x, ld y){
    ld ans = 1e18;
    auto proc = [&](ld p, ld q){
        chmin(ans,hypot(x-p,y-q));
    };
    proc(-c,0);
    proc(0,-c);
    proc(a+c,-a);
    proc(a+c+a,0);
    proc(a+c+b,a+b);
    proc(0,b+c+b);
    proc(-b,b+c);
    return ans;
}

ld calc(ld a, ld b, ld c){
    auto fixx = [&](ld x){
        ld ly = 0, ry = b;
        int many = 120;
        while (many--){
            ld m1 = (ly + ly + ry) / 3;
            ld m2 = (ly + ry + ry) / 3;
            if (dist(a,b,c,x,m1) < dist(a,b,c,x,m2)){
                ly = m1;
            }
            else {
                ry = m2;
            }
        }
        return dist(a,b,c,x,ly);
    };
    ld lx = 0, rx = a;
    int many = 120;
    while (many--){
        ld m1 = (lx + lx + rx) / 3;
        ld m2 = (lx + rx + rx) / 3;
        if (fixx(m1) < fixx(m2)){
            lx = m1;
        }
        else {
            rx = m2;
        }
    }
    return fixx(lx);
}

int main(){
    ld a, b, c; cin >> a >> b >> c;
    cout << fixed << setprecision(15);
    ld ans = 0;
    chmax(ans,calc(a,b,c));
    chmax(ans,calc(b,c,a));
    chmax(ans,calc(c,a,b));
    cout << ans << endl;
}
accuracy: 1
time_ms: 40
memory_kb: 3840
final_rank: 1

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
std::mt19937 mt(768);

double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  for (int q = 0; q < 50; q++) {
    int T = 10000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.6568627450980392
time_ms: 1890
memory_kb: 3624
final_rank: 5

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 10000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.12745098039215685
time_ms: 1870
memory_kb: 3580
final_rank: 16

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.9705882352941176
time_ms: 1900
memory_kb: 3576
final_rank: 2

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(131);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.6568627450980392
time_ms: 1960
memory_kb: 3612
final_rank: 6

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(1381);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.3431372549019608
time_ms: 1960
memory_kb: 3572
final_rank: 11

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(13481);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.12745098039215685
time_ms: 1880
memory_kb: 3576
final_rank: 15

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 55000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.12745098039215685
time_ms: 1860
memory_kb: 3572
final_rank: 13

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 5000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.058823529411764705
time_ms: 170
memory_kb: 3504
final_rank: 18

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 110000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.12745098039215685
time_ms: 1860
memory_kb: 3576
final_rank: 14

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 55000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  // ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.12745098039215685
time_ms: 920
memory_kb: 3520
final_rank: 12

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 40; q++) {
    int T = 60000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  // ans = std::max(ans, c_all(b, c, a));
  // ans = std::max(ans, c_all(c, a, b));
  // ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.029411764705882353
time_ms: 900
memory_kb: 3404
final_rank: 19

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 40; q++) {
    int T = 60000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.8333333333333334
time_ms: 1960
memory_kb: 3576
final_rank: 4

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 55000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.3431372549019608
time_ms: 1940
memory_kb: 3576
final_rank: 10

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 45; q++) {
    int T = 6000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.3627450980392157
time_ms: 200
memory_kb: 3576
final_rank: 8

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a = (xl + xr) / 2;
    double b = (yl + yr) / 2;
    std::vector<std::vector<double>> cands = {
        {xl, a, yl, b},  //
        {a, xr, yl, b},  //
        {xl, a, b, yr},  //
        {a, xr, b, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.9705882352941176
time_ms: 1880
memory_kb: 3620
final_rank: 3

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 40000;
    double hoge = 1;
    double a2 = (xl * (hoge + 1) + xr * (hoge + 0)) / (hoge * 2 + 1);
    double b2 = (yl * (hoge + 1) + yr * (hoge + 0)) / (hoge * 2 + 1);
    double a1 = (xl * (hoge + 0) + xr * (hoge + 1)) / (hoge * 2 + 1);
    double b1 = (yl * (hoge + 0) + yr * (hoge + 1)) / (hoge * 2 + 1);
    std::vector<std::vector<double>> cands = {
        {xl, a1, yl, b1},  //
        {a2, xr, yl, b1},  //
        {xl, a1, b2, yr},  //
        {a2, xr, b2, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.35294117647058826
time_ms: 1520
memory_kb: 3580
final_rank: 9

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 50000;
    double hoge = 1;
    double a2 = (xl * (hoge + 1) + xr * (hoge + 0)) / (hoge * 2 + 1);
    double b2 = (yl * (hoge + 1) + yr * (hoge + 0)) / (hoge * 2 + 1);
    double a1 = (xl * (hoge + 0) + xr * (hoge + 1)) / (hoge * 2 + 1);
    double b1 = (yl * (hoge + 0) + yr * (hoge + 1)) / (hoge * 2 + 1);
    std::vector<std::vector<double>> cands = {
        {xl, a1, yl, b1},  //
        {a2, xr, yl, b1},  //
        {xl, a1, b2, yr},  //
        {a2, xr, b2, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.5980392156862745
time_ms: 1880
memory_kb: 3580
final_rank: 7

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 10000;
    double hoge = 3;
    double a1 = (xl * (hoge + 1) + xr * (hoge + 0)) / (hoge * 2 + 1);
    double b1 = (yl * (hoge + 1) + yr * (hoge + 0)) / (hoge * 2 + 1);
    double a2 = (xl * (hoge + 0) + xr * (hoge + 1)) / (hoge * 2 + 1);
    double b2 = (yl * (hoge + 0) + yr * (hoge + 1)) / (hoge * 2 + 1);
    std::vector<std::vector<double>> cands = {
        {xl, a1, yl, b1},  //
        {a2, xr, yl, b1},  //
        {xl, a1, b2, yr},  //
        {a2, xr, b2, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.00980392156862745
time_ms: 370
memory_kb: 3576
final_rank: 20

code_snippet: #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
double c_all(double a_, double b_, double c_) {
  std::vector<std::vector<double>> vs = {
      {-a_ - b_, c_},            //
      {+a_ + b_, c_},            //
      {b_, -a_ - c_},            //
      {-2 * a_ - b_, -a_ - c_},  //
      {-c_, +a_ + b_},           //
      {-c_, -a_ - b_},           //
      {b_ + c_, a_ + 2 * b_},    //
      {b_ + c_, -a_},            //
  };
  // for (size_t i = 0; i < vs.size(); i++) {
  //   std::cerr << vs.at(i).at(0) << ", " << vs.at(i).at(1) << std::endl;
  // }

  auto calc = [&](double x, double y) {
    double min = 1e9;
    for (auto& v : vs) {
      double dx = x - v[0];
      double dy = y - v[1];
      min = std::min(min, dx * dx + dy * dy);
    }
    return min;
  };

  double xl = 0;
  double xr = b_;
  double yl = 0;
  double yr = -a_;

  std::mt19937 mt(768);
  for (int q = 0; q < 50; q++) {
    int T = 10000;
    double hoge = 3;
    double a2 = (xl * (hoge + 1) + xr * (hoge + 0)) / (hoge * 2 + 1);
    double b2 = (yl * (hoge + 1) + yr * (hoge + 0)) / (hoge * 2 + 1);
    double a1 = (xl * (hoge + 0) + xr * (hoge + 1)) / (hoge * 2 + 1);
    double b1 = (yl * (hoge + 0) + yr * (hoge + 1)) / (hoge * 2 + 1);
    std::vector<std::vector<double>> cands = {
        {xl, a1, yl, b1},  //
        {a2, xr, yl, b1},  //
        {xl, a1, b2, yr},  //
        {a2, xr, b2, yr},  //
    };
    std::vector<double> sum(4, 0);
    for (int s = 0; s < 4; s++) {
      std::uniform_real_distribution<double> xdist(cands[s][0], cands[s][1]);
      std::uniform_real_distribution<double> ydist(cands[s][2], cands[s][3]);
      for (int i = 0; i < T; i++) {
        double x = xdist(mt);
        double y = ydist(mt);
        sum[s] = std::max(sum[s], calc(x, y));
      }
    }
    int mi = std::max_element(sum.begin(), sum.end()) - sum.begin();

    // std::cerr << "xl : " << xl << ", "  //
    //           << "xr : " << xr << ", "  //
    //           << "yl : " << yl << ", "  //
    //           << "yr : " << yr << ", "  //
    //           << std::endl;
    // std::cerr << "sum[0] : " << sum[0] << ", "  //
    //           << "sum[1] : " << sum[1] << ", "  //
    //           << "sum[2] : " << sum[2] << ", "  //
    //           << "sum[3] : " << sum[3] << ", "  //
    //           << std::endl;
    xl = cands[mi][0];
    xr = cands[mi][1];
    yl = cands[mi][2];
    yr = cands[mi][3];
  }
  // std::cout << std::sqrt(calc(xl, yl)) << std::endl;
  return sqrt(calc(xl, yl));
}

int main() {
  double a, b, c;
  std::cin >> a >> b >> c;
  double ans = -1;
  ans = std::max(ans, c_all(a, b, c));
  ans = std::max(ans, c_all(a, c, b));
  ans = std::max(ans, c_all(b, a, c));
  ans = std::max(ans, c_all(b, c, a));
  ans = std::max(ans, c_all(c, a, b));
  ans = std::max(ans, c_all(c, b, a));
  std::cout << std::setprecision(14) << ans << std::endl;
}
accuracy: 0.0784313725490196
time_ms: 370
memory_kb: 3580
final_rank: 17