QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687765#8505. Almost AlignedmaspyAC ✓672ms137796kbC++2321.5kb2024-10-29 21:06:182024-10-29 21:06:20

Judging History

你现在查看的是最新测评结果

  • [2024-10-29 21:06:20]
  • 评测
  • 测评结果:AC
  • 用时:672ms
  • 内存:137796kb
  • [2024-10-29 21:06:18]
  • 提交

answer

#line 1 "/home/maspy/compro/library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else

// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;

template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;

using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;

#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
  vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))

// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)

#define FOR_subset(t, s) for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define stoi stoll

int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_mod_2(int x) { return __builtin_parity(x); }
int popcnt_mod_2(u32 x) { return __builtin_parity(x); }
int popcnt_mod_2(ll x) { return __builtin_parityll(x); }
int popcnt_mod_2(u64 x) { return __builtin_parityll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }

template <typename T>
T floor(T a, T b) {
  return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
  return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
  return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

template <typename T, typename U>
T SUM(const vector<U> &A) {
  T sm = 0;
  for (auto &&a: A) sm += a;
  return sm;
}

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()

template <typename T>
T POP(deque<T> &que) {
  T a = que.front();
  que.pop_front();
  return a;
}
template <typename T>
T POP(pq<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(pqg<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
  if (check_ok) assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    (check(x) ? ok : ng) = x;
  }
  return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
  FOR(iter) {
    double x = (ok + ng) / 2;
    (check(x) ? ok : ng) = x;
  }
  return (ok + ng) / 2;
}

template <class T, class S>
inline bool chmax(T &a, const S &b) {
  return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
  return (a > b ? a = b, 1 : 0);
}

// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
  vc<int> A(S.size());
  FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
  return A;
}

template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
  int N = A.size();
  vector<T> B(N + 1);
  FOR(i, N) { B[i + 1] = B[i] + A[i]; }
  if (off == 0) B.erase(B.begin());
  return B;
}

// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
  vector<int> ids(len(A));
  iota(all(ids), 0);
  sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
  return ids;
}

// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
  vc<T> B(len(I));
  FOR(i, len(I)) B[i] = A[I[i]];
  return B;
}

template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
  vc<T> &res = first;
  (res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "/home/maspy/compro/library/other/io.hpp"
#define FASTIO
#include <unistd.h>

// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;

struct Pre {
  char num[10000][4];
  constexpr Pre() : num() {
    for (int i = 0; i < 10000; i++) {
      int n = i;
      for (int j = 3; j >= 0; j--) {
        num[i][j] = n % 10 | '0';
        n /= 10;
      }
    }
  }
} constexpr pre;

inline void load() {
  memcpy(ibuf, ibuf + pil, pir - pil);
  pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
  pil = 0;
  if (pir < SZ) ibuf[pir++] = '\n';
}

inline void flush() {
  fwrite(obuf, 1, por, stdout);
  por = 0;
}

void rd(char &c) {
  do {
    if (pil + 1 > pir) load();
    c = ibuf[pil++];
  } while (isspace(c));
}

void rd(string &x) {
  x.clear();
  char c;
  do {
    if (pil + 1 > pir) load();
    c = ibuf[pil++];
  } while (isspace(c));
  do {
    x += c;
    if (pil == pir) load();
    c = ibuf[pil++];
  } while (!isspace(c));
}

template <typename T>
void rd_real(T &x) {
  string s;
  rd(s);
  x = stod(s);
}

template <typename T>
void rd_integer(T &x) {
  if (pil + 100 > pir) load();
  char c;
  do
    c = ibuf[pil++];
  while (c < '-');
  bool minus = 0;
  if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
    if (c == '-') { minus = 1, c = ibuf[pil++]; }
  }
  x = 0;
  while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
  if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
    if (minus) x = -x;
  }
}

void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }

template <class T, class U>
void rd(pair<T, U> &p) {
  return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
  if constexpr (N < std::tuple_size<T>::value) {
    auto &x = std::get<N>(t);
    rd(x);
    rd_tuple<N + 1>(t);
  }
}
template <class... T>
void rd(tuple<T...> &tpl) {
  rd_tuple(tpl);
}

template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
  for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
  for (auto &d: x) rd(d);
}

void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
  rd(h), read(t...);
}

void wt(const char c) {
  if (por == SZ) flush();
  obuf[por++] = c;
}
void wt(const string s) {
  for (char c: s) wt(c);
}
void wt(const char *s) {
  size_t len = strlen(s);
  for (size_t i = 0; i < len; i++) wt(s[i]);
}

template <typename T>
void wt_integer(T x) {
  if (por > SZ - 100) flush();
  if (x < 0) { obuf[por++] = '-', x = -x; }
  int outi;
  for (outi = 96; x >= 10000; outi -= 4) {
    memcpy(out + outi, pre.num[x % 10000], 4);
    x /= 10000;
  }
  if (x >= 1000) {
    memcpy(obuf + por, pre.num[x], 4);
    por += 4;
  } else if (x >= 100) {
    memcpy(obuf + por, pre.num[x] + 1, 3);
    por += 3;
  } else if (x >= 10) {
    int q = (x * 103) >> 10;
    obuf[por] = q | '0';
    obuf[por + 1] = (x - q * 10) | '0';
    por += 2;
  } else
    obuf[por++] = x | '0';
  memcpy(obuf + por, out + outi + 4, 96 - outi);
  por += 96 - outi;
}

template <typename T>
void wt_real(T x) {
  ostringstream oss;
  oss << fixed << setprecision(15) << double(x);
  string s = oss.str();
  wt(s);
}

void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }

template <class T, class U>
void wt(const pair<T, U> val) {
  wt(val.first);
  wt(' ');
  wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
  if constexpr (N < std::tuple_size<T>::value) {
    if constexpr (N > 0) { wt(' '); }
    const auto x = std::get<N>(t);
    wt(x);
    wt_tuple<N + 1>(t);
  }
}
template <class... T>
void wt(tuple<T...> tpl) {
  wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
  auto n = val.size();
  for (size_t i = 0; i < n; i++) {
    if (i) wt(' ');
    wt(val[i]);
  }
}
template <class T>
void wt(const vector<T> val) {
  auto n = val.size();
  for (size_t i = 0; i < n; i++) {
    if (i) wt(' ');
    wt(val[i]);
  }
}

void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  wt(head);
  if (sizeof...(Tail)) wt(' ');
  print(forward<Tail>(tail)...);
}

// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;

#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __VA_ARGS__; \
  read(__VA_ARGS__)
#define U32(...)   \
  u32 __VA_ARGS__; \
  read(__VA_ARGS__)
#define U64(...)   \
  u64 __VA_ARGS__; \
  read(__VA_ARGS__)
#define STR(...)      \
  string __VA_ARGS__; \
  read(__VA_ARGS__)
#define CHAR(...)   \
  char __VA_ARGS__; \
  read(__VA_ARGS__)
#define DBL(...)      \
  double __VA_ARGS__; \
  read(__VA_ARGS__)

#define VEC(type, name, size) \
  vector<type> name(size);    \
  read(name)
#define VV(type, name, h, w)                     \
  vector<vector<type>> name(h, vector<type>(w)); \
  read(name)

void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"

#line 2 "/home/maspy/compro/library/geo/convex_hull.hpp"

#line 2 "/home/maspy/compro/library/geo/base.hpp"
template <typename T>
struct Point {
  T x, y;

  Point() : x(0), y(0) {}

  template <typename A, typename B>
  Point(A x, B y) : x(x), y(y) {}

  template <typename A, typename B>
  Point(pair<A, B> p) : x(p.fi), y(p.se) {}

  Point operator+=(const Point p) {
    x += p.x, y += p.y;
    return *this;
  }
  Point operator-=(const Point p) {
    x -= p.x, y -= p.y;
    return *this;
  }
  Point operator+(Point p) const { return {x + p.x, y + p.y}; }
  Point operator-(Point p) const { return {x - p.x, y - p.y}; }
  bool operator==(Point p) const { return x == p.x && y == p.y; }
  bool operator!=(Point p) const { return x != p.x || y != p.y; }
  Point operator-() const { return {-x, -y}; }
  Point operator*(T t) const { return {x * t, y * t}; }
  Point operator/(T t) const { return {x / t, y / t}; }

  bool operator<(Point p) const {
    if (x != p.x) return x < p.x;
    return y < p.y;
  }
  T dot(const Point& other) const { return x * other.x + y * other.y; }
  T det(const Point& other) const { return x * other.y - y * other.x; }

  double norm() { return sqrtl(x * x + y * y); }
  double angle() { return atan2(y, x); }

  Point rotate(double theta) {
    static_assert(!is_integral<T>::value);
    double c = cos(theta), s = sin(theta);
    return Point{c * x - s * y, s * x + c * y};
  }
  Point rot90(bool ccw) { return (ccw ? Point{-y, x} : Point{y, -x}); }
};

#ifdef FASTIO
template <typename T>
void rd(Point<T>& p) {
  fastio::rd(p.x), fastio::rd(p.y);
}
template <typename T>
void wt(Point<T>& p) {
  fastio::wt(p.x);
  fastio::wt(' ');
  fastio::wt(p.y);
}
#endif

// A -> B -> C と進むときに、左に曲がるならば +1、右に曲がるならば -1
template <typename T>
int ccw(Point<T> A, Point<T> B, Point<T> C) {
  T x = (B - A).det(C - A);
  if (x > 0) return 1;
  if (x < 0) return -1;
  return 0;
}

template <typename REAL, typename T, typename U>
REAL dist(Point<T> A, Point<U> B) {
  REAL dx = REAL(A.x) - REAL(B.x);
  REAL dy = REAL(A.y) - REAL(B.y);
  return sqrt(dx * dx + dy * dy);
}

// ax+by+c
template <typename T>
struct Line {
  T a, b, c;

  Line(T a, T b, T c) : a(a), b(b), c(c) {}
  Line(Point<T> A, Point<T> B) { a = A.y - B.y, b = B.x - A.x, c = A.x * B.y - A.y * B.x; }
  Line(T x1, T y1, T x2, T y2) : Line(Point<T>(x1, y1), Point<T>(x2, y2)) {}

  template <typename U>
  U eval(Point<U> P) {
    return a * P.x + b * P.y + c;
  }

  template <typename U>
  T eval(U x, U y) {
    return a * x + b * y + c;
  }

  // 同じ直線が同じ a,b,c で表現されるようにする
  void normalize() {
    static_assert(is_same_v<T, int> || is_same_v<T, long long>);
    T g = gcd(gcd(abs(a), abs(b)), abs(c));
    a /= g, b /= g, c /= g;
    if (b < 0) { a = -a, b = -b, c = -c; }
    if (b == 0 && a < 0) { a = -a, b = -b, c = -c; }
  }

  bool is_parallel(Line other) { return a * other.b - b * other.a == 0; }
  bool is_orthogonal(Line other) { return a * other.a + b * other.b == 0; }
};

template <typename T>
struct Segment {
  Point<T> A, B;

  Segment(Point<T> A, Point<T> B) : A(A), B(B) {}
  Segment(T x1, T y1, T x2, T y2) : Segment(Point<T>(x1, y1), Point<T>(x2, y2)) {}

  bool contain(Point<T> C) {
    T det = (C - A).det(B - A);
    if (det != 0) return 0;
    return (C - A).dot(B - A) >= 0 && (C - B).dot(A - B) >= 0;
  }

  Line<T> to_Line() { return Line(A, B); }
};

template <typename REAL>
struct Circle {
  Point<REAL> O;
  REAL r;
  Circle(Point<REAL> O, REAL r) : O(O), r(r) {}
  Circle(REAL x, REAL y, REAL r) : O(x, y), r(r) {}
  template <typename T>
  bool contain(Point<T> p) {
    REAL dx = p.x - O.x, dy = p.y - O.y;
    return dx * dx + dy * dy <= r * r;
  }
};
#line 4 "/home/maspy/compro/library/geo/convex_hull.hpp"

// allow_180=true で同一座標点があるとこわれる
// full なら I[0] が sorted で min になる
template <typename T, bool allow_180 = false>
vector<int> ConvexHull(vector<Point<T>>& XY, string mode = "full", bool sorted = false) {
  assert(mode == "full" || mode == "lower" || mode == "upper");
  ll N = XY.size();
  if (N == 1) return {0};
  if (N == 2) {
    if (XY[0] < XY[1]) return {0, 1};
    if (XY[1] < XY[0]) return {1, 0};
    return {0};
  }
  vc<int> I(N);
  if (sorted) {
    FOR(i, N) I[i] = i;
  } else {
    I = argsort(XY);
  }
  if constexpr (allow_180) { FOR(i, N - 1) assert(XY[i] != XY[i + 1]); }

  auto check = [&](ll i, ll j, ll k) -> bool {
    T det = (XY[j] - XY[i]).det(XY[k] - XY[i]);
    if constexpr (allow_180) return det >= 0;
    return det > T(0);
  };

  auto calc = [&]() {
    vector<int> P;
    for (auto&& k: I) {
      while (P.size() > 1) {
        auto i = P[P.size() - 2];
        auto j = P[P.size() - 1];
        if (check(i, j, k)) break;
        P.pop_back();
      }
      P.eb(k);
    }
    return P;
  };

  vc<int> P;
  if (mode == "full" || mode == "lower") {
    vc<int> Q = calc();
    P.insert(P.end(), all(Q));
  }
  if (mode == "full" || mode == "upper") {
    if (!P.empty()) P.pop_back();
    reverse(all(I));
    vc<int> Q = calc();
    P.insert(P.end(), all(Q));
  }
  if (mode == "upper") reverse(all(P));
  while (len(P) >= 2 && XY[P[0]] == XY[P.back()]) P.pop_back();
  return P;
}
#line 5 "main.cpp"

using Re = double;

using T4 = tuple<Re, Re, Re, Re>;
using T6 = tuple<Re, Re, Re, Re, Re, Re>;

// [L,R,a,b] の列
// -> [L,R,a,b,c,d] の列
vc<T6> merge(vc<T4> A, vc<T4> B) {
  vc<T6> ANS;
  reverse(all(A));
  reverse(all(B));
  SHOW(A);
  SHOW(B);
  while (len(A) && len(B)) {
    auto& [l1, r1, a1, b1] = A.back();
    auto& [l2, r2, a2, b2] = B.back();
    SHOW(l1, r1, l2, r2);
    assert(l1 == l2);
    Re r = min(r1, r2);
    ANS.eb(l1, r, a1, b1, a2, b2);
    l1 = r, l2 = r;
    if (r1 == r) POP(A);
    if (r2 == r) POP(B);
  };
  return ANS;
}

// 1 次関数の max を [L,R,a,b] の列として出力
template <typename Re, typename T>
vc<tuple<Re, Re, Re, Re>> line_min_function_real(vc<pair<T, T>> LINE) {
  SHOW(LINE);
  assert(!LINE.empty());
  using P = Point<T>;
  vc<P> point;
  for (auto& [x, y]: LINE) point.eb(P(x, y));
  auto I = ConvexHull(point, "lower");
  point = rearrange(point, I);
  int N = len(point);
  if (N >= 2 && point[N - 1].x == point[N - 2].x) { POP(point), --N; }
  reverse(all(point)); // 傾きは大きい方から
  Re l = -infty<Re>;
  vc<tuple<Re, Re, Re, Re>> ANS;
  FOR(i, N) {
    Re r = infty<Re>;
    auto [a, b] = point[i];
    if (i + 1 < N) {
      auto [c, d] = point[i + 1];
      if (a == c) continue;
      assert(a > c);
      SHOW(a, b, c, d);
      r = Re(d - b) / (a - c);
      chmax(r, l), chmin(r, infty<Re>);
    }
    if (l < r) ANS.eb(l, r, a, b), l = r;
  }
  return ANS;
}

// 1 次関数の max を [L,R,a,b] の列として出力
template <typename Re, typename T>
vc<tuple<Re, Re, Re, Re>> line_max_function_real(vc<pair<T, T>> LINE) {
  assert(!LINE.empty());
  for (auto& [a, b]: LINE) a = -a, b = -b;
  auto ANS = line_min_function_real<Re, T>(LINE);
  for (auto& [l, r, a, b]: ANS) a = -a, b = -b;
  return ANS;
}

void solve() {
  LL(N);
  vi X(N), Y(N), VX(N), VY(N);
  FOR(i, N) read(X[i], Y[i], VX[i], VY[i]);

  auto sub = [&](vi A, vi B) -> vc<T4> {
    vc<pi> dat;
    FOR(i, N) dat.eb(A[i], B[i]);
    vc<T4> D = line_min_function_real<Re>(dat);
    vc<T4> U = line_max_function_real<Re>(dat);
    SHOW(D);
    SHOW(U);
    vc<T6> F = merge(U, D);
    vc<T4> res;
    for (auto& [l, r, a, b, c, d]: F) {
      // (ax+b)-(cx+d)
      res.eb(l, r, a - c, b - d);
    }
    return res;
  };

  auto A = sub(VX, X);
  auto B = sub(VY, Y);
  auto dat = merge(A, B);
  Re ANS = 2 * infty<Re>;
  for (auto& [l, r, a, b, c, d]: dat) {
    chmax(l, 0);
    if (l > r) continue;
    auto f = [&](Re x) -> Re { return (a * x + b) * (c * x + d); };
    chmin(ANS, f(l));
    chmin(ANS, f(r));
    if (a != 0 && c != 0) {
      Re x = (a * d + b * c) / (2 * a * c);
      if (l <= x && x <= r) chmin(ANS, f(x));
    }
  }
  SHOW(ANS);
  print(ANS);
}

signed main() { solve(); }

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4088kb

input:

4
0 0 10 10
0 0 10 10
10 10 -10 -10
10 0 -20 0

output:

22.222222222222221

result:

ok found '22.222222222', expected '22.222222222', error '0.000000000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 4088kb

input:

3
0 -1 0 2
1 1 1 1
-1 1 -1 1

output:

0.000000000000000

result:

ok found '0.000000000', expected '0.000000000', error '-0.000000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

3
0 -1 0 -2
1 1 1 1
-1 1 -1 1

output:

4.000000000000000

result:

ok found '4.000000000', expected '4.000000000', error '0.000000000'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

1
0 0 0 0

output:

0.000000000000000

result:

ok found '0.000000000', expected '0.000000000', error '-0.000000000'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

4
1000000 1000000 -1 -1000000
1000000 -1000000 -1000000 1
-1000000 -1000000 1 1000000
-1000000 1000000 1000000 -1

output:

3999984000031.998046875000000

result:

ok found '3999984000031.998046875', expected '3999984000032.000000000', error '0.000000000'

Test #6:

score: 0
Accepted
time: 643ms
memory: 137324kb

input:

1000000
-871226 486657 -467526 31395
-65837 846554 469710 -907814
927993 -45099 713462 -276539
261942 483255 746021 811070
63449 -779486 588838 -413687
812070 -87868 -813499 -420768
112521 -622607 -832012 921368
-182120 517379 -401743 -837524
-685985 337832 643014 135144
12895 326935 -495720 930620
...

output:

3999996000000.000000000000000

result:

ok found '3999996000000.000000000', expected '3999996000000.000000000', error '0.000000000'

Test #7:

score: 0
Accepted
time: 652ms
memory: 137120kb

input:

1000000
3663 6989 -2671 9642
9904 -8111 -4995 5797
599 -8323 -9362 -9045
-6740 1530 3072 6531
3681 -6009 593 -7248
-7878 7266 -5191 4871
4007 -3346 -3801 -3512
192 4840 -4026 -1845
6224 -6143 -1857 5659
-5960 4616 9665 655
5532 -1324 -3901 351
-7670 3951 9243 -4678
2931 -115 -5127 -2353
-7500 -7221 ...

output:

400000000.000000000000000

result:

ok found '400000000.000000000', expected '400000000.000000000', error '0.000000000'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

10
-1 19 -2 6
-26 4 -8 0
6 27 0 7
-3 9 -1 -4
4 -5 5 -5
30 -21 -7 6
-23 -6 0 -5
0 19 3 -5
19 -22 -6 -5
-5 9 -2 5

output:

2744.000000000000000

result:

ok found '2744.000000000', expected '2744.000000000', error '0.000000000'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

10
-3 30 6 7
25 -7 -5 -6
21 8 8 6
-5 19 -6 -1
29 14 -4 -8
-18 15 -7 4
-1 -2 6 -4
-9 -23 -9 -10
-17 12 7 -6
28 16 -7 -4

output:

2491.000000000000000

result:

ok found '2491.000000000', expected '2491.000000000', error '0.000000000'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3912kb

input:

100
259 401 17 5
145 -361 -30 -7
397 314 23 -29
-53 332 -19 -5
-11 413 4 -29
-152 -336 1 -26
479 -7 17 -5
142 121 3 24
93 -424 6 -16
387 -138 20 6
136 99 3 -19
-168 181 5 -26
416 -259 26 -28
-108 328 -11 15
247 190 -16 0
-446 473 27 -20
-450 -116 3 -23
79 -409 4 -13
-192 184 -18 -27
50 22 23 -7
187 ...

output:

951042.036882807849906

result:

ok found '951042.036882808', expected '951042.036882808', error '0.000000000'

Test #11:

score: 0
Accepted
time: 0ms
memory: 4204kb

input:

100
78 -474 17 -17
439 -473 2 -18
-81 -8 -23 14
405 363 -19 23
-85 491 -10 -11
130 433 -10 24
363 406 -26 -25
370 -110 29 -23
179 -354 -9 -14
155 -183 30 16
9 373 -17 -9
-376 486 16 -22
19 -221 15 -1
-449 253 27 19
-275 369 -17 13
-200 -412 -9 26
-184 -249 2 -25
103 -407 4 -20
326 28 -4 29
145 -101 ...

output:

985195.419501133728772

result:

ok found '985195.419501134', expected '985195.419501134', error '0.000000000'

Test #12:

score: 0
Accepted
time: 51ms
memory: 17008kb

input:

100000
-967368 981728 -282756 336437
261266 269990 509802 144678
462067 -410569 -758751 -855049
-223324 236410 -518913 543981
830399 -945912 -925250 -799821
-708921 186464 583718 422275
-764681 -276675 -270713 155951
-736997 136674 155052 -266181
191391 -482614 -181940 748298
85598 963827 730561 168...

output:

3999878000858.000000000000000

result:

ok found '3999878000858.000000000', expected '3999878000858.000000000', error '0.000000000'

Test #13:

score: 0
Accepted
time: 40ms
memory: 17016kb

input:

100000
735591 227533 -560510 -492634
151314 -955343 -798474 615112
-405134 -371377 72931 71513
995160 468797 39541 -692246
-412359 -48711 381217 49510
-33387 908154 -552594 -470470
893889 28395 -979649 -864267
-667790 324922 -645051 -356687
528418 -766919 496442 -133957
-667748 -194840 -961485 -8606...

output:

3999945328884.535156250000000

result:

ok found '3999945328884.535156250', expected '3999945328884.535156250', error '0.000000000'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

4
1 1 -2 -3
-2 1 4 -5
4 -1 0 -2
-3 -4 -1 5

output:

10.484375000000000

result:

ok found '10.484375000', expected '10.484375000', error '0.000000000'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

3
3 -1 5 -5
-1 1 -1 -4
0 4 -3 -5

output:

20.000000000000000

result:

ok found '20.000000000', expected '20.000000000', error '0.000000000'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3956kb

input:

1
2 -2 -1 -3

output:

0.000000000000000

result:

ok found '0.000000000', expected '0.000000000', error '-0.000000000'

Test #17:

score: 0
Accepted
time: 0ms
memory: 4176kb

input:

9
2 1 0 -5
1 3 4 0
-2 2 5 5
-5 -1 4 0
-5 -1 3 0
4 3 0 -3
4 -5 1 1
5 -1 -2 -5
2 -4 -2 1

output:

69.444444444444457

result:

ok found '69.444444444', expected '69.444444444', error '0.000000000'

Test #18:

score: 0
Accepted
time: 0ms
memory: 4088kb

input:

3
-5 1 1 -4
-1 1 5 4
1 0 -2 0

output:

6.000000000000000

result:

ok found '6.000000000', expected '6.000000000', error '0.000000000'

Test #19:

score: 0
Accepted
time: 0ms
memory: 4116kb

input:

3
485996 232438 356271 686535
316095 -82403 -663737 -892162
-301128 -973876 -705273 342014

output:

949518700936.000000000000000

result:

ok found '949518700936.000000000', expected '949518700936.000000000', error '0.000000000'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

3
-307334 408041 -520618 -752353
-111541 -171569 622704 -397094
-856154 25489 -1939 897474

output:

431585140930.000000000000000

result:

ok found '431585140930.000000000', expected '431585140930.000000000', error '0.000000000'

Test #21:

score: 0
Accepted
time: 0ms
memory: 4016kb

input:

4
554523 -843525 434069 -518131
910677 518840 -857480 -612229
231960 965891 333430 -440474
-687304 726302 164236 659483

output:

2493690369944.078613281250000

result:

ok found '2493690369944.078613281', expected '2493690369944.078125000', error '0.000000000'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

4
269831 -364179 -591251 516327
-578364 795567 -872538 -766732
-896806 -70577 -998004 159063
-962947 -103040 -47465 -189048

output:

577576180387.100341796875000

result:

ok found '577576180387.100341797', expected '577576180387.100463867', error '0.000000000'

Test #23:

score: 0
Accepted
time: 0ms
memory: 4060kb

input:

10
-120900 371317 -965845 999010
105720 -738865 -573556 47269
959567 790508 -501437 -94217
900701 822342 916298 873194
351985 737907 523995 486812
224233 -197678 -958739 -157846
-571724 -329927 757807 -207627
-88478 -130810 866209 -314752
793192 -931648 355041 81069
-639238 265325 279197 331273

output:

2798954762226.749023437500000

result:

ok found '2798954762226.749023438', expected '2798954762226.749023438', error '0.000000000'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

37
-131846 614 862 168
-22220 13697 258 -10
26616 -348199 -210 1685
220 -329964 -150 1615
-13860 60289 170 -266
311355 32897 -2296 -138
366795 -11239 -2548 -475
555 281 504 -955
-2948 -280564 -6 1415
-27596 -307239 306 1525
-137036 8237 882 42
221496 -5164 -1834 -625
521411 -353499 -3164 1705
-76580...

output:

24803016000.000000000000000

result:

ok found '24803016000.000000000', expected '24803016000.000000000', error '0.000000000'

Test #25:

score: 0
Accepted
time: 0ms
memory: 4136kb

input:

73
-108673 389998 924 -1380
-302273 81982 1804 276
306682 -227947 -2168 1350
-308909 -182187 1828 1030
27322 -840937 -616 4130
-278557 500974 1716 -1788
-97 386944 -324 -1368
-184673 -501697 1324 2810
6822 15454 -288 1068
48166 -114427 -832 470
-11009 -829377 28 4090
297882 9934 -2136 1188
-14657 23...

output:

50487256537.649009704589844

result:

ok found '50487256537.649009705', expected '50487256537.649009705', error '0.000000000'

Test #26:

score: 0
Accepted
time: 0ms
memory: 4020kb

input:

25
150 41240 110 -76
150 -71806 110 127
-135 100373 -117 -457
-135 -120701 -117 360
-135 -71304 -117 125
-135 -185507 -117 853
-135 -96206 -117 228
-135 -89846 -117 199
150 106114 110 -512
-135 -364728 -117 3338
-135 -240138 -117 1435
-135 -136915 -117 463
150 38262 110 -66
-135 -486593 -117 5988
15...

output:

212632515.000000000000000

result:

ok found '212632515.000000000', expected '212632515.000000000', error '0.000000000'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3916kb

input:

41
-122 -202188 -87 806
-122 52097 -87 -91
-122 -110676 -87 239
-122 972577 -87 -39244
-122 75229 -87 -192
-122 56435 -87 -107
287 87094 60 -258
-122 -199083 -87 781
287 -184883 60 672
287 -275157 60 1505
-122 118150 -87 -478
-122 -278109 -87 1538
287 130564 60 -586
-122 143093 -87 -705
-122 68022 -...

output:

1191259126.000000000000000

result:

ok found '1191259126.000000000', expected '1191259126.000000000', error '0.000000000'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3896kb

input:

21
119 -197341 278 623
119 237192 278 -1735
-170 115213 -179 -407
119 -333873 278 1788
-170 -123517 -179 243
119 106232 278 -346
-170 76440 -179 -179
119 -243252 278 947
-170 77161 -179 -182
-170 -116197 -179 215
-170 -418509 -179 2815
119 -156876 278 393
-170 142274 -179 -622
119 99148 278 -301
119...

output:

194540639.000000000000000

result:

ok found '194540639.000000000', expected '194540639.000000000', error '0.000000000'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

52
23226 2213006 166 -6062
24273 -752443 145 2006
-12122 -541692 -77 862
-12248 -718713 -72 1753
20598 -580462 186 1012
-11508 1774135 -85 -3327
-9506 1602295 -97 -2613
-10671 2009925 -91 -4586
-11185 2227296 -88 -6185
21120 -910732 183 5000
19412 1812993 192 -3510
-7724 -868819 -104 3425
-11724 -76...

output:

125246379975.000000000000000

result:

ok found '125246379975.000000000', expected '125246379975.000000000', error '0.000000000'

Test #30:

score: 0
Accepted
time: 0ms
memory: 4100kb

input:

81
1279 -1391850 110 2693
-5581 749030 -67 -1663
-1446 725783 -109 -1560
-2673 934965 -103 -2656
-495 1075634 118 -3641
-861 -1317952 119 2417
532 -3102617 -118 17186
-1951 656020 -107 -1273
-5314 -1343298 -78 2510
-5336 1706111 -78 -15413
-4699 942468 -87 -2703
-5437 1728733 -75 -17163
-5581 162143...

output:

60713678976.203575134277344

result:

ok found '60713678976.203575134', expected '60713678976.203567505', error '0.000000000'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3976kb

input:

96
317600 -19315 -2762 270
112920 -10765 -1558 170
-596007 -58589 2599 562
326609 -93419 -2804 742
-658727 -26099 2823 334
11784 -98675 -354 766
-677223 -170635 2887 1046
-434087 -174157 1959 1058
271680 255676 -2538 -1720
163880 -148075 -1922 966
-352575 214936 1591 -1552
92592 -85805 -1390 706
-11...

output:

25001307840.000000000000000

result:

ok found '25001307840.000000000', expected '25001307840.000000000', error '0.000000000'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3944kb

input:

60
236950 -44186 -1301 802
80755 -81944 -599 1174
-1855 -396104 -297 2854
49219 79895 -383 -520
-62239 2073 111 148
134899 14345 -887 -60
-4363 27743 -253 -192
260 -483746 -387 3178
-2443 -21410 -285 490
-22843 -93560 -85 1270
205999 128927 -1187 -736
-16380 158943 -131 -848
-63748 -328346 117 2578
...

output:

13421332344.000000000000000

result:

ok found '13421332344.000000000', expected '13421332344.000000000', error '0.000000000'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

92
-27 87933 -220 -131
-27 -14009 -220 75
176 87578 243 -130
176 24916727 243 -56830393
-27 96534 -220 -167
176 79844 243 -100
176 579902 243 -7747
-27 183847 -220 -731
176 94435 243 -158
176 1236906 243 -35877
-27 -15711 -220 82
176 -20799 243 109
-27 221175 -220 -1080
-27 -15782 -220 82
-27 -39936...

output:

1133378807.569099187850952

result:

ok found '1133378807.569099188', expected '1133378807.569099188', error '0.000000000'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

18
-11401 2040394 -1 -3478
-16100 3380115 35 -18616
-15953 -3452146 30 17723
3826 3170586 161 -11918
2453 -2130527 168 3400
3521 2006744 163 -3354
-15451 -2270978 23 3979
3024 -2171378 166 3561
3039 -2290644 165 4066
-16125 2968499 37 -9258
-15451 2986878 23 -9457
-14111 -3325407 12 13346
3918 21785...

output:

131300734952.319061279296875

result:

ok found '131300734952.319061279', expected '131300734952.319061279', error '0.000000000'

Test #35:

score: 0
Accepted
time: 0ms
memory: 3916kb

input:

63
8634 -327887 40 1001
8003 -344736 43 1132
-15438 3463286 -205 -8940
10698 -386325 13 1548
-7037 4275429 -263 -16119
-9425 -260464 -254 612
-12515 -252168 -237 575
-8767 3403504 -256 -8559
-14285 -295330 -223 791
-5698 -270655 -268 660
10113 2867959 27 -5705
10367 -411538 23 1908
-10008 -453487 -2...

output:

143194408232.005035400390625

result:

ok found '143194408232.005035400', expected '143194408232.005065918', error '0.000000000'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

23
-94952 68947 -78244 -27146
-530055 8704 37309 2546
36034 -567466 15179 92756
-75284 -49745 -70002 -85312
-157499 303298 46742 59667
-71290 439854 -19145 -12865
400801 -15976 40569 -82509
486415 9986 32685 74047
66737 -168433 -49145 -91724
-439617 -25982 23423 55502
468911 236710 6726 -74659
-1432...

output:

1130302263930.523681640625000

result:

ok found '1130302263930.523681641', expected '1130302263930.523681641', error '0.000000000'

Test #37:

score: 0
Accepted
time: 0ms
memory: 3900kb

input:

86
-454345 133174 -70991 2455
-654523 -543404 20175 -9746
10687 221247 81248 -11815
92173 97804 -23392 -66209
-78829 68999 -51961 -16128
-241144 160625 95460 -8235
-458489 -17222 76821 -46127
134016 -183019 -3387 52391
-152130 -493910 45356 63829
-461772 122387 4164 92555
-594378 80658 -34597 -53401...

output:

823163776978.863037109375000

result:

ok found '823163776978.863037109', expected '823163776978.863037109', error '0.000000000'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

66
47401 -251812 72881 47555
-87102 -176698 -3989 55781
-9451 -306797 66004 28653
59439 -836264 81343 37295
23144 140391 55923 93565
-22088 1077055 -74006 47921
84140 121601 64874 50227
-78242 -225050 90375 96828
69955 133342 53684 -90064
6006 -181319 30734 3308
62346 -397007 921 24071
-28228 -41296...

output:

914921063784.000000000000000

result:

ok found '914921063784.000000000', expected '914921063784.000000000', error '0.000000000'

Test #39:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

32
99231 2916135 -77623 56208
-85960 2211600 -61440 12629
-49928 3462080 60153 -28354
23296 2217586 94942 -101833
-52557 3351482 65222 69373
-67970 -2796151 61119 -55606
4572 1928693 -48201 55472
-106303 3377928 -99113 -7420
-58445 -3725627 -81751 -56501
45866 -4388025 11865 -33487
82266 -3794190 38...

output:

1613463481070.000000000000000

result:

ok found '1613463481070.000000000', expected '1613463481070.000000000', error '0.000000000'

Test #40:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

75
-2172 -2947346 -98067 -54664
-86594 946831 -78900 70369
44892 -4517875 81585 24583
60290 -3099219 -76740 7781
104640 -4479613 28653 77080
-85434 -5419217 14378 100717
72209 960890 -14761 6599
12607 -5718720 38073 -3623
81199 905951 18182 7413
-405 709614 95596 74051
-93444 1178468 28192 25084
706...

output:

1619047187360.815917968750000

result:

ok found '1619047187360.815917969', expected '1619047187360.815917969', error '0.000000000'

Test #41:

score: 0
Accepted
time: 0ms
memory: 4072kb

input:

92
68317 -229095 57197 -3676
71653 47473 -49458 -35669
-15512 4458 -19823 -60548
-466442 -40611 12611 9419
-274463 2482 31069 44336
135958 -7961 34661 -4112
-108882 -92478 -793 -25634
-19800 -63451 75856 -93782
-501804 -292892 -64046 -13826
-307453 -149217 59759 -65549
-738120 157721 -9332 -88269
88...

output:

469627105578.000000000000000

result:

ok found '469627105578.000000000', expected '469627105578.000000000', error '0.000000000'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

51
-85150 849 17599 96720
-15046 128140 -8186 -94952
186331 38872 -33945 -78193
-8855 -129604 70426 27661
15564 -65427 11952 35883
-42523 -38206 9238 72955
-100805 -64626 78945 71438
-919 5201 -63468 40968
75531 45319 92144 65504
158565 -79247 -63848 -1444
125170 -95337 -12110 -31973
-316875 313635 ...

output:

396317255220.000000000000000

result:

ok found '396317255220.000000000', expected '396317255220.000000000', error '0.000000000'

Test #43:

score: 0
Accepted
time: 0ms
memory: 4196kb

input:

43
41903 177035 -38256 -35523
21683 138621 39109 66482
53649 108772 -24362 41348
879 7261631 -88394 -2440165
-18048 -160891 11647 97791
-28435 40984 -85312 82952
-87141 -219991 8921 -95964
43003 67926 -73740 -53308
57741 55622 86653 -28598
20371 634659 -29659 -57286
-22207 -246919 74282 46743
33474 ...

output:

2611634551344.472167968750000

result:

ok found '2611634551344.472167969', expected '2611634551344.471679688', error '0.000000000'

Test #44:

score: 0
Accepted
time: 0ms
memory: 4128kb

input:

41
60992 -15995352 61677 112307
52541 43678309 -47957 -500346
-57867 19181306 -13680 -53548
-62166 126337986 54858 -5008607
45460 20355065 79552 -192880
-39095 54261886 -85867 -704612
15170 26330639 -49044 -225908
37954 -5742401 42435 74489
-86802 4554569 12004 -61251
-84878 -19254701 -47655 177031
...

output:

48723974667304.343750000000000

result:

ok found '48723974667304.343750000', expected '48723974667304.343750000', error '0.000000000'

Test #45:

score: 0
Accepted
time: 0ms
memory: 4024kb

input:

97
-20824 4455418 -96157 62241
78107 6867029 -8381 -95055
46642 6131768 46374 -8106
86567 -2019145 -16539 11543
-58536 -1808953 -27772 10837
-21672 -3163675 35678 -31488
-71318 8585557 23511 -146034
-1063 4640930 52316 -54693
10614 5280407 2753 20352
-61713 -2176500 -2269 46236
-35339 4645729 -22528...

output:

3005488978226.308593750000000

result:

ok found '3005488978226.308593750', expected '3005488978226.308593750', error '0.000000000'

Test #46:

score: 0
Accepted
time: 192ms
memory: 53904kb

input:

331970
-389145 -40601 2313 424
-415794 151042 2439 -870
456801 -158 -2004 1530
-262938 -10953 1647 152
-447330 -66681 2583 584
-163794 80752 999 -210
-381693 258962 2277 -1630
-93405 57512 405 70
-408090 212912 2403 -1330
317145 215842 -1452 -1350
-233058 -164441 1467 1000
-47730 292162 -117 -1830
-...

output:

106758246420.000000000000000

result:

ok found '106758246420.000000000', expected '106758246420.000000000', error '0.000000000'

Test #47:

score: 0
Accepted
time: 182ms
memory: 53956kb

input:

321800
2370 2819171 63 -8250
-19640 2922464 -190 -9084
4631 1933332 51 -3422
2257 1958593 64 -3518
1985 2021310 65 -3766
1705 2132783 66 -4237
4925 -329783 48 575
-7038 2412098 -263 -5609
-16614 3075076 -219 -10482
-13954 -356784 -234 681
-13772 -663186 -235 4848
-20223 2087115 -178 -4039
3912 -5034...

output:

115715491313.062683105468750

result:

ok found '115715491313.062683105', expected '115715491313.062683105', error '0.000000000'

Test #48:

score: 0
Accepted
time: 200ms
memory: 63160kb

input:

436064
26 -501325 239 4992
-196 -398911 -286 3155
26 -4498551 239 431604
-196 37277 -286 -371
26 -147043 239 426
26 15518 239 -64
-196 -131096 -286 339
-196 -147899 -286 431
-196 13615 -286 -49
-196 6406 -286 -10
26 195821 239 -10629
26 -405279 239 3257
-196 -247330 -286 1209
26 28326 239 -213
-196 ...

output:

5057507088.558156013488770

result:

ok found '5057507088.558156013', expected '5057507088.558156013', error '0.000000000'

Test #49:

score: 0
Accepted
time: 250ms
memory: 60264kb

input:

434346
-399725 -16927 3664 100
38713 -22207 -206 220
-227735 -39807 2684 540
-166135 7780 2244 225
120118 -77557 -876 1040
414713 -72367 -2206 980
-453415 31183 3924 51
-411815 -529117 3724 3880
-146135 -16117 2084 80
713 -153877 554 1760
88438 -645277 -656 4360
353773 -882207 -1986 5220
171118 6050...

output:

50625000000.000000000000000

result:

ok found '50625000000.000000000', expected '50625000000.000000000', error '0.000000000'

Test #50:

score: 0
Accepted
time: 488ms
memory: 117860kb

input:

769586
-1518 5597607 212 -16809
-1702 4400115 -25 -10507
1720 5651683 -49 -17137
-9414 12390315 244 -121020
6816 10647928 126 -73265
-1744 8550061 -24 -41791
87 -11333791 -42 122194
-1327 5762342 -31 -17820
-1029 -6465708 -34 25439
-905 -7328817 -35 33796
4494 -3312269 172 6464
4580 -6359724 171 245...

output:

219366805987.930480957031250

result:

ok found '219366805987.930480957', expected '219366805987.930511475', error '0.000000000'

Test #51:

score: 0
Accepted
time: 127ms
memory: 46112kb

input:

281749
-95 -253775 -62 668
-95 -387354 -62 1612
-95 169914 -62 -348
-257 -165996 -335 262
-257 -557734 -335 3391
-95 287632 -62 -925
-95 -188672 -62 351
-257 249391 -335 -705
-257 -223877 -335 511
-95 -817283 -62 7351
-95 347291 -62 -1332
-95 234432 -62 -627
-95 1678634 -62 -30783
-95 -1309271 -62 1...

output:

9986855518.683509826660156

result:

ok found '9986855518.683509827', expected '9986855518.683509827', error '0.000000000'

Test #52:

score: 0
Accepted
time: 292ms
memory: 64244kb

input:

454481
86410 73744 -682 -426
16076 -238 274 120
19873 88 181 77
-542873 -82374 2543 447
-22067 -49275 -1178 318
12670 38163 334 -279
3409 40153 650 -278
339354 -75615 -2320 439
88064 -22793 -697 194
-846786 45121 3709 -311
39068 -205 -141 106
-403980 1 1910 -118
-231028 -9415 933 84
-640059 10565 29...

output:

17755534005.002998352050781

result:

ok found '17755534005.002998352', expected '17755534005.002998352', error '0.000000000'

Test #53:

score: 0
Accepted
time: 431ms
memory: 98760kb

input:

606634
15353 2388078 158 -5723
14737 1887998 161 -3217
-3113 2596185 -19 -7234
15892 2914558 138 -10668
-3017 -2498147 -33 6814
-3217 2523119 -23 -6661
-3605 3155511 -22 -16027
15429 -2427667 138 6276
17787 1952722 131 -3494
-3565 -1695312 -17 2622
-3403 3139862 -24 -15440
11766 2505124 157 -6539
-2...

output:

136978082640.000000000000000

result:

ok found '136978082640.000000000', expected '136978082640.000000000', error '0.000000000'

Test #54:

score: 0
Accepted
time: 600ms
memory: 126192kb

input:

881500
110 293207 126 -1182
-212 204353 -298 -579
-211 233136 -282 -757
112 281871 131 -1101
99 2119420 124 -64660
-213 -26455 -296 60
-214 -72240 -288 387
118 -81780 137 502
104 -178200 127 2372
-222 137300 -278 -268
99 254291 132 -885
104 -48519 131 170
-212 -25645 -295 56
103 215208 120 -633
106 ...

output:

8073976501.865249633789062

result:

ok found '8073976501.865249634', expected '8073976501.865249634', error '0.000000000'

Test #55:

score: 0
Accepted
time: 391ms
memory: 87456kb

input:

581926
213217 -196574 -1318 1031
-176462 -109367 1020 480
39759 -7792 -271 -711
25367 355972 -113 -1592
21 337528 467 -1523
241832 417146 -1437 -1826
-13533 -106146 -189 447
6172 -114283 223 520
-360077 33152 1739 253
357374 -110979 -1859 497
195132 26909 -1241 321
-166527 -43369 975 -128
2458 4977 ...

output:

61021038195.000000000000000

result:

ok found '61021038195.000000000', expected '61021038195.000000000', error '0.000000000'

Test #56:

score: 0
Accepted
time: 436ms
memory: 90304kb

input:

614509
-1372 -3287515 278 6397
2882 -3807805 236 8460
-3962 -4802200 287 13247
-8358 -7571457 314 33176
-5293 2078427 297 -5030
264 2164277 48 -5417
-2237 1836565 98 -4058
-1632 2509437 67 -7089
5685 -14733631 32 186782
3495 -13396717 233 133294
-1407 -4268092 78 10538
-4861 -15113957 299 209222
550...

output:

152933546198.832519531250000

result:

ok found '152933546198.832519531', expected '152933546198.832519531', error '0.000000000'

Test #57:

score: 0
Accepted
time: 594ms
memory: 118352kb

input:

845031
-54 -59094 -74 601
-281 -18277 -509 303
-285 303559 -497 -1211
-64 -29969 -88 345
-60 -27435 -81 340
-63 227013 -80 -554
-276 -18158 -504 288
-275 -74145 -500 785
-70 -17430 -80 285
-54 166036 -87 -164
-280 -28023 -511 346
-271 120854 -508 25
-271 -107639 -504 1379
-59 3589799 -78 -217168
-28...

output:

6389303263.105774879455566

result:

ok found '6389303263.105774879', expected '6389303263.105774879', error '0.000000000'

Test #58:

score: 0
Accepted
time: 319ms
memory: 69480kb

input:

494762
123647 -217948 -1309 1288
63220 5284 -703 475
210162 541735 -551 -4353
45296 -44336 561 -195
-123497 -118219 531 414
-481231 -271692 1097 2538
287034 126321 -2788 -1603
-110316 -264 -308 -890
-215996 -979 474 -207
137216 423044 -862 -2703
-164741 32668 353 -993
-231945 -360324 617 1751
-32107...

output:

338014064478.302185058593750

result:

ok found '338014064478.302185059', expected '338014064478.302185059', error '0.000000000'

Test #59:

score: 0
Accepted
time: 465ms
memory: 108896kb

input:

693481
39125 -1396480 -171 3229
35176 1227492 -205 -4316
-7139 -1389189 -323 3164
-9175 -1486133 -146 3234
-9064 -1958963 -929 6243
24759 -1582282 200 3348
-7864 880050 318 -2565
-9340 794935 -588 -848
-6970 -1993541 124 5716
38513 908744 785 -1673
-8593 756811 -456 -1730
31663 -1618601 -411 4007
35...

output:

172515254272.000000000000000

result:

ok found '172515254272.000000000', expected '172515254272.000000000', error '0.000000000'

Test #60:

score: 0
Accepted
time: 204ms
memory: 52560kb

input:

327671
-563 159042 -474 -428
-946 -3018525 -690 625200
-29 -46232 936 405
449 -34384 -511 716
905 63693 -68 -226
-211 -146985 -769 1871
-108 -71321 -294 880
90 -147895 -925 1603
-513 58653 283 -592
690 -102369 632 430
547 81542 414 -67
732 190998 660 -1149
334 -97314 -816 897
306 -110435 419 236
551...

output:

31456300872.506523132324219

result:

ok found '31456300872.506523132', expected '31456300872.506523132', error '0.000000000'

Test #61:

score: 0
Accepted
time: 256ms
memory: 62616kb

input:

421276
-37264 -361051 -416 1832
-159096 -450910 1172 3460
-61821 603 236 3652
277905 337505 -1420 -1127
291392 61261 -2104 1652
1083 -377548 709 2432
-36609 37264 357 2505
-214218 394787 1746 83
14055 701893 1093 -1860
220481 -579702 -616 2284
-206472 -42148 1697 169
2885 289316 384 -932
69162 14919...

output:

438206965166.717346191406250

result:

ok found '438206965166.717346191', expected '438206965166.717346191', error '0.000000000'

Test #62:

score: 0
Accepted
time: 594ms
memory: 125448kb

input:

888432
4708 -3187505 -281 5609
6566 -3170418 -449 6554
3238 -5347409 556 20264
-15285 3572667 -63 -7014
-11488 -4245844 -279 10446
3251 5950578 -1019 -32509
5260 -4687545 -763 14246
4824 2992577 462 -3913
4447 4119717 81 -10267
-14786 -5805800 -98 28253
4824 -4991469 -1192 16596
-9979 -4010647 -940 ...

output:

272063548890.000000000000000

result:

ok found '272063548890.000000000', expected '272063548890.000000000', error '0.000000000'

Test #63:

score: 0
Accepted
time: 604ms
memory: 129364kb

input:

927163
-201 222428 -1352 -232
866 -142360 376 340
1246 102763 -519 513
1196 -2911526 972 128807
541 -1230541 -92 21851
870 162486 -1120 -760
594 135846 -462 160
603 -175339 -478 744
-467 -699500 -137 7682
210 -136040 -583 511
738 164269 -880 -486
1200 381548 -476 -3316
-595 488015 -650 -3329
190 115...

output:

92953003755.526458740234375

result:

ok found '92953003755.526458740', expected '92953003755.526473999', error '0.000000000'

Test #64:

score: 0
Accepted
time: 149ms
memory: 36932kb

input:

252109
-197235 469133 -95153 19465
-21714 168089 97335 26945
-122008 -106564 39768 100154
87398 391987 -54594 -27035
-32537 37372 3218 66112
-523426 -192948 82272 -53497
36879 -59751 89375 5438
315546 -25765 63752 -35472
-62759 62889 -24513 -69482
560982 999079 -68652 88332
-129490 229583 -33234 -37...

output:

2685358484072.548828125000000

result:

ok found '2685358484072.548828125', expected '2685358484072.548828125', error '0.000000000'

Test #65:

score: 0
Accepted
time: 214ms
memory: 56280kb

input:

356193
49118 4043532 61839 38715
-97525 9355060 71992 -98721
-1613 -6573170 8528 -22229
-3814 -13240637 11227 27376
-89077 6426076 94757 36715
-78813 -4938196 -98662 -3131
25877 -2244915 51133 -69496
77051 39311734 23707 -573751
-28926 12487975 -69714 -164869
-33945 -8495725 5150 140429
-44176 45321...

output:

22038075351051.007812500000000

result:

ok found '22038075351051.007812500', expected '22038075351051.007812500', error '0.000000000'

Test #66:

score: 0
Accepted
time: 629ms
memory: 133052kb

input:

956577
-94118 -9323 -30470 -83379
11298 138809 22997 -62535
-11425 107360 -31535 -85208
-64307 48637 -65554 86172
-12986 216936 -57771 -56662
24652 9117 -38522 -8216
45276 359150 60834 16572
12418 8714626 -66969 -3079978
26496 128681 6470 70636
-7182 46255 -46477 -92895
-36599 -99608 -66344 71564
-4...

output:

2260291418765.169921875000000

result:

ok found '2260291418765.169921875', expected '2260291418765.170410156', error '0.000000000'

Test #67:

score: 0
Accepted
time: 444ms
memory: 100612kb

input:

700279
26920 33724 -35606 -83310
-34504 501154 -59620 89880
17231 792724 11204 -37531
27819 57472 -90751 -96483
-10222 130423 -1062 -6416
-87632 105983 -8487 42471
1667 -16514 73728 -73547
122299 -141411 -57825 94199
-38477 -145635 55095 8030
-10016 36255 -75089 -49133
4303 34840 65324 19533
-25696 ...

output:

473162036348.654357910156250

result:

ok found '473162036348.654357910', expected '473162036348.654357910', error '0.000000000'

Test #68:

score: 0
Accepted
time: 351ms
memory: 91480kb

input:

561246
68389 -30559150 -72221 122828
-33221 9752738 -3713 22869
44428 16758022 43095 14744
59866 10478383 20211 40047
46590 -36891110 90362 216795
-46028 10525566 13213 -52446
8329 -16903607 -63145 -39570
-59885 -13883482 -85007 24283
79851 28100145 2932 -206620
49252 -18013732 -72427 129834
47979 3...

output:

52718599580296.000000000000000

result:

ok found '52718599580296.000000000', expected '52718599580296.000000000', error '0.000000000'

Test #69:

score: 0
Accepted
time: 412ms
memory: 93980kb

input:

651395
25925 125092 31084 46649
-35796 -326320 37144 17278
-72978 408163 -19755 -77650
-52005 51821 -96211 17690
91861 407830 56096 85834
45733 -10439070 -34304 698919
94076 -1149073 51529 80567
70836 -867241 50299 -58454
-15157 -2232931 25480 -61854
88811 110056 28652 59188
-51387 -620979 -45389 -8...

output:

6010570685728.000000000000000

result:

ok found '6010570685728.000000000', expected '6010570685728.000000000', error '0.000000000'

Test #70:

score: 0
Accepted
time: 657ms
memory: 137796kb

input:

1000000
0 -4 4 -3
4 -2 5 2
-2 -5 -4 -5
-5 5 -2 2
0 2 3 2
-2 -4 5 2
-2 -3 5 0
-3 1 3 4
-2 -1 4 1
-4 -2 -1 -1
-1 -1 1 1
-1 -4 2 5
-5 -4 1 -5
-3 -4 -1 0
2 -1 1 -5
-3 1 5 5
-5 -4 -1 5
-5 0 3 3
2 -1 5 -2
-2 -3 -2 -4
1 3 5 -3
-1 3 -3 2
-2 1 4 5
4 -4 4 -5
-3 0 5 -2
-2 -1 -1 1
3 -4 -1 2
2 3 3 0
5 -3 0 -3
3 ...

output:

100.000000000000000

result:

ok found '100.000000000', expected '100.000000000', error '0.000000000'

Test #71:

score: 0
Accepted
time: 649ms
memory: 136552kb

input:

1000000
0 0 -4 0
4 -3 -1 3
-1 2 4 0
1 0 0 5
-3 2 -2 2
-1 -2 -5 -2
-1 -2 3 -3
-4 1 3 4
4 -4 -4 3
4 -2 4 0
1 -4 0 -2
-4 0 -4 -4
-4 3 5 3
4 -2 -4 -5
-4 -3 5 -1
0 -5 4 -1
-5 -3 1 -2
-5 4 5 -4
-4 2 -4 -2
2 4 -4 2
3 -3 -3 -2
3 -2 4 1
0 -5 -3 -3
2 0 -5 -4
-4 5 2 4
5 2 1 -2
0 -3 0 -4
-2 4 -4 -3
-4 -4 0 -3
-...

output:

100.000000000000000

result:

ok found '100.000000000', expected '100.000000000', error '0.000000000'

Test #72:

score: 0
Accepted
time: 672ms
memory: 136764kb

input:

1000000
-5 0 1 -3
4 5 -3 0
1 -4 4 -4
-3 -3 -2 0
4 -2 -4 5
5 5 2 1
5 -5 -5 -1
5 -4 -5 -3
3 -2 3 5
-1 -5 -5 1
2 4 -5 -2
5 4 2 0
2 -2 -5 0
2 -3 1 -5
-5 0 5 -1
-4 2 -1 -3
-3 -1 4 -1
-4 -2 5 4
-4 0 4 1
-4 -1 3 -1
4 -2 -3 1
3 1 -5 -5
-2 0 -1 -2
5 0 0 -4
-3 0 3 4
-3 2 2 3
5 2 4 -2
2 -5 -4 5
-3 -2 2 3
-1 -2...

output:

100.000000000000000

result:

ok found '100.000000000', expected '100.000000000', error '0.000000000'

Test #73:

score: 0
Accepted
time: 642ms
memory: 136512kb

input:

1000000
547496 -465543 896839 763224
990369 -123835 -322500 499257
-393537 -885286 -93965 14711
-474817 553416 -353228 -771238
169071 -862560 680571 539234
-935557 156256 -733685 -939014
-207676 255247 371216 -566652
-571116 378574 -162389 100442
872662 157370 -901056 895937
-832888 495134 670735 69...

output:

3999992000003.000000000000000

result:

ok found '3999992000003.000000000', expected '3999992000003.000000000', error '0.000000000'

Test #74:

score: 0
Accepted
time: 617ms
memory: 137496kb

input:

1000000
-391982 -332842 -403027 -74117
245407 427370 -154885 -702558
811170 484778 -679747 -665545
661339 932413 -883774 990617
-69555 -152702 -851656 298730
-680259 -543984 260330 -480655
988685 -537795 737001 664340
758878 876580 -755116 408543
-713352 -646798 981806 834790
-850011 910052 193877 2...

output:

3999993408204.703613281250000

result:

ok found '3999993408204.703613281', expected '3999993408204.703613281', error '0.000000000'

Test #75:

score: 0
Accepted
time: 628ms
memory: 136852kb

input:

1000000
890185 471609 -304359 -813027
942212 623156 579232 656310
38691 429197 -708815 814242
443954 -162199 -981510 582331
-111589 415497 117235 -497550
226464 149483 -629062 -255144
-571851 149715 -170622 351137
591007 -893579 410400 -275661
861574 -648425 117160 -781113
83083 615975 691458 305688...

output:

3999998000000.000000000000000

result:

ok found '3999998000000.000000000', expected '3999998000000.000000000', error '0.000000000'

Test #76:

score: 0
Accepted
time: 640ms
memory: 136760kb

input:

1000000
745675004 851410181 879150117 -564480142
-259777446 -479656907 -616127457 -2312322
-577710654 123202332 806258276 481023740
-219312507 554513034 -47523417 918524035
331285983 773848875 326456968 682146633
332075067 781890504 588242457 549721998
808931791 -78429682 -808206051 -239255177
66433...

output:

3999988118768951808.000000000000000

result:

ok found '3999988118768951808.000000000', expected '3999988118768951808.000000000', error '0.000000000'

Test #77:

score: 0
Accepted
time: 644ms
memory: 136852kb

input:

999994
-135150090 395077957 874697252 756527767
-981335995 -678914407 874697252 -22129066
-999425704 -8921137 874697252 981434034
915404655 -531273224 874697252 -146158525
970074731 -575138413 874697252 -992507804
214046359 -615798131 874697252 -269721617
711292215 670878931 874697252 -648989100
-40...

output:

3999975348970324992.000000000000000

result:

ok found '3999975348970324992.000000000', expected '3999975348970324992.000000000', error '0.000000000'

Test #78:

score: 0
Accepted
time: 626ms
memory: 136796kb

input:

999999
408071721 -611453221 -196666151 -959416833
-357683071 -29261282 -478337358 -959416833
-575903739 -224046934 853520732 -959416833
-919209314 -109732621 -605000554 -959416833
219321000 649258320 291904212 -959416833
369248375 892873044 30284665 -959416833
117280146 -445259244 532290407 -9594168...

output:

3999984286653532160.000000000000000

result:

ok found '3999984286653532160.000000000', expected '3999984286653532160.000000000', error '0.000000000'

Test #79:

score: 0
Accepted
time: 599ms
memory: 137240kb

input:

1000000
27720 27720 -1 27720
55442 0 -2 13860
83166 -9240 -3 9240
110892 -13860 -4 6930
138620 -16632 -5 5544
166350 -18480 -6 4620
194082 -19800 -7 3960
221816 -20790 -8 3465
249552 -21560 -9 3080
277290 -22176 -10 2772
305030 -22680 -11 2520
332772 -23100 -12 2310
388248 -21780 -14 1980
415995 -22...

output:

19524773976790.621093750000000

result:

ok found '19524773976790.621093750', expected '19524773976793.570312500', error '0.000000000'

Test #80:

score: 0
Accepted
time: 53ms
memory: 17032kb

input:

100000
27720 27720 -1 27720
55444 -13860 -2 13860
83172 -27720 -3 9240
110904 -34650 -4 6930
138640 -38808 -5 5544
166380 -41580 -6 4620
194124 -43560 -7 3960
221872 -45045 -8 3465
249624 -46200 -9 3080
277380 -47124 -10 2772
305140 -47880 -11 2520
332904 -48510 -12 2310
388416 -45540 -14 1980
41619...

output:

39182923485842.250000000000000

result:

ok found '39182923485842.250000000', expected '39182923485894.281250000', error '0.000000000'

Test #81:

score: 0
Accepted
time: 5ms
memory: 5084kb

input:

10000
27720 27720 -1 27720
55446 -27720 -2 13860
83178 -46200 -3 9240
110916 -55440 -4 6930
138660 -60984 -5 5544
166410 -64680 -6 4620
194166 -67320 -7 3960
221928 -69300 -8 3465
249696 -70840 -9 3080
277470 -72072 -10 2772
305250 -73080 -11 2520
333036 -73920 -12 2310
388584 -69300 -14 1980
416385...

output:

58974448527304.789062500000000

result:

ok found '58974448527304.789062500', expected '58974448527302.125000000', error '0.000000000'

Test #82:

score: 0
Accepted
time: 53ms
memory: 17112kb

input:

100000
27720 27720 -1 27720
55460 -124740 -2 13860
83220 -175560 -3 9240
111000 -200970 -4 6930
138800 -216216 -5 5544
166620 -226380 -6 4620
194460 -233640 -7 3960
222320 -239085 -8 3465
250200 -243320 -9 3080
278100 -246708 -10 2772
306020 -249480 -11 2520
333960 -251790 -12 2310
389760 -235620 -1...

output:

201249638721756.187500000000000

result:

ok found '201249638721756.187500000', expected '201249638721756.968750000', error '0.000000000'

Test #83:

score: 0
Accepted
time: 46ms
memory: 16976kb

input:

100000
27720 27720 -1 27720
55486 -304920 -2 13860
83298 -415800 -3 9240
111156 -471240 -4 6930
139060 -504504 -5 5544
167010 -526680 -6 4620
195006 -542520 -7 3960
223048 -554400 -8 3465
251136 -563640 -9 3080
279270 -571032 -10 2772
307450 -577080 -11 2520
335676 -582120 -12 2310
391944 -544500 -1...

output:

482813811139910.187500000000000

result:

ok found '482813811139910.187500000', expected '482813811139958.375000000', error '0.000000000'

Test #84:

score: 0
Accepted
time: 54ms
memory: 17176kb

input:

100000
27720 27720 -1 27720
55540 -679140 -2 13860
83460 -914760 -3 9240
111480 -1032570 -4 6930
139600 -1103256 -5 5544
167820 -1150380 -6 4620
196140 -1184040 -7 3960
224560 -1209285 -8 3465
253080 -1228920 -9 3080
281700 -1244628 -10 2772
310420 -1257480 -11 2520
339240 -1268190 -12 2310
396480 -...

output:

1139623725915913.250000000000000

result:

ok found '1139623725915913.250000000', expected '1139623725915924.500000000', error '0.000000000'

Test #85:

score: 0
Accepted
time: 53ms
memory: 16884kb

input:

100000
27720 27720 -1 27720
55600 -1094940 -2 13860
83640 -1469160 -3 9240
111840 -1656270 -4 6930
140200 -1768536 -5 5544
168720 -1843380 -6 4620
197400 -1896840 -7 3960
226240 -1936935 -8 3465
255240 -1968120 -9 3080
284400 -1993068 -10 2772
313720 -2013480 -11 2520
343200 -2030490 -12 2310
401520...

output:

1983448600233980.250000000000000

result:

ok found '1983448600233980.250000000', expected '1983448600234046.500000000', error '0.000000000'

Test #86:

score: 0
Accepted
time: 53ms
memory: 17440kb

input:

100000
27720 27720 -1 27720
55610 -1164240 -2 13860
83670 -1561560 -3 9240
111900 -1760220 -4 6930
140300 -1879416 -5 5544
168870 -1958880 -6 4620
197610 -2015640 -7 3960
226520 -2058210 -8 3465
255600 -2091320 -9 3080
284850 -2117808 -10 2772
314270 -2139480 -11 2520
343860 -2157540 -12 2310
402360...

output:

2135756438363826.250000000000000

result:

ok found '2135756438363826.250000000', expected '2135756438363941.500000000', error '0.000000000'

Test #87:

score: 0
Accepted
time: 46ms
memory: 17116kb

input:

100000
27720 27720 -1 27720
55612 -1178100 -2 13860
83676 -1580040 -3 9240
111912 -1781010 -4 6930
140320 -1901592 -5 5544
168900 -1981980 -6 4620
197652 -2039400 -7 3960
226576 -2082465 -8 3465
255672 -2115960 -9 3080
284940 -2142756 -10 2772
314380 -2164680 -11 2520
343992 -2182950 -12 2310
402528...

output:

2166618132586811.250000000000000

result:

ok found '2166618132586811.250000000', expected '2166618132586842.000000000', error '0.000000000'

Test #88:

score: 0
Accepted
time: 49ms
memory: 17068kb

input:

100000
27720 27720 -1 27720
55614 -1191960 -2 13860
83682 -1598520 -3 9240
111924 -1801800 -4 6930
140340 -1923768 -5 5544
168930 -2005080 -6 4620
197694 -2063160 -7 3960
226632 -2106720 -8 3465
255744 -2140600 -9 3080
285030 -2167704 -10 2772
314490 -2189880 -11 2520
344124 -2208360 -12 2310
402696...

output:

2197613202342044.500000000000000

result:

ok found '2197613202342044.500000000', expected '2197613202342049.500000000', error '0.000000000'

Extra Test:

score: 0
Extra Test Passed