QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#761591#8779. Square of TrianglesmaspyAC ✓57ms3952kbC++2328.4kb2024-11-19 01:21:522024-11-19 01:21:53

Judging History

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

  • [2024-11-19 01:21:53]
  • 评测
  • 测评结果:AC
  • 用时:57ms
  • 内存:3952kb
  • [2024-11-19 01:21:52]
  • 提交

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_sgn(int x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(u32 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(ll x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(u64 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
// (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 kth_bit(int k) {
  return T(1) << k;
}
template <typename T>
bool has_kth_bit(T x, int k) {
  return x >> k & 1;
}

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/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 2 "/home/maspy/compro/library/geo/cross_point.hpp"

#line 4 "/home/maspy/compro/library/geo/cross_point.hpp"

// 平行でないことを仮定
template <typename REAL, typename T>
Point<REAL> cross_point(const Line<T> L1, const Line<T> L2) {
  T det = L1.a * L2.b - L1.b * L2.a;
  assert(det != 0);
  REAL x = -REAL(L1.c) * L2.b + REAL(L1.b) * L2.c;
  REAL y = -REAL(L1.a) * L2.c + REAL(L1.c) * L2.a;
  return Point<REAL>(x / det, y / det);
}

// 浮動小数点数はエラー
// 0: 交点なし
// 1: 一意な交点
// 2:2 つ以上の交点(整数型を利用して厳密にやる)
template <typename T>
int count_cross(Segment<T> S1, Segment<T> S2, bool include_ends) {
  static_assert(!std::is_floating_point<T>::value);
  Line<T> L1 = S1.to_Line();
  Line<T> L2 = S2.to_Line();
  if (L1.is_parallel(L2)) {
    if (L1.eval(S2.A) != 0) return 0;
    // 4 点とも同一直線上にある
    T a1 = S1.A.x, b1 = S1.B.x;
    T a2 = S2.A.x, b2 = S2.B.x;
    if (a1 == b1) {
      a1 = S1.A.y, b1 = S1.B.y;
      a2 = S2.A.y, b2 = S2.B.y;
    }
    if (a1 > b1) swap(a1, b1);
    if (a2 > b2) swap(a2, b2);
    T a = max(a1, a2);
    T b = min(b1, b2);
    if (a < b) return 2;
    if (a > b) return 0;
    return (include_ends ? 1 : 0);
  }
  // 平行でない場合
  T a1 = L2.eval(S1.A), b1 = L2.eval(S1.B);
  T a2 = L1.eval(S2.A), b2 = L1.eval(S2.B);
  if (a1 > b1) swap(a1, b1);
  if (a2 > b2) swap(a2, b2);
  bool ok1 = 0, ok2 = 0;

  if (include_ends) {
    ok1 = (a1 <= T(0)) && (T(0) <= b1);
    ok2 = (a2 <= T(0)) && (T(0) <= b2);
  } else {
    ok1 = (a1 < T(0)) && (T(0) < b1);
    ok2 = (a2 < T(0)) && (T(0) < b2);
  }
  return (ok1 && ok2 ? 1 : 0);
}

// https://codeforces.com/contest/607/problem/E
template <typename REAL, typename T>
vc<Point<REAL>> cross_point(const Circle<T> C, const Line<T> L) {
  T a = L.a, b = L.b, c = L.a * (C.O.x) + L.b * (C.O.y) + L.c;
  T r = C.r;
  bool SW = 0;
  if (abs(a) < abs(b)) {
    swap(a, b);
    SW = 1;
  }
  // ax+by+c=0, x^2+y^2=r^2
  T D = 4 * c * c * b * b - 4 * (a * a + b * b) * (c * c - a * a * r * r);
  if (D < 0) return {};
  REAL sqD = sqrtl(D);
  REAL y1 = (-2 * b * c + sqD) / (2 * (a * a + b * b));
  REAL y2 = (-2 * b * c - sqD) / (2 * (a * a + b * b));
  REAL x1 = (-b * y1 - c) / a;
  REAL x2 = (-b * y2 - c) / a;
  if (SW) swap(x1, y1), swap(x2, y2);
  x1 += C.O.x, x2 += C.O.x;
  y1 += C.O.y, y2 += C.O.y;
  if (D == 0) return {Point<REAL>(x1, y1)};
  return {Point<REAL>(x1, y1), Point<REAL>(x2, y2)};
}

// https://codeforces.com/contest/2/problem/C
template <typename REAL, typename T>
tuple<bool, Point<T>, Point<T>> cross_point_circle(Circle<T> C1, Circle<T> C2) {
  using P = Point<T>;
  P O{0, 0};
  P A = C1.O, B = C2.O;
  if (A == B) return {false, O, O};
  T d = (B - A).norm();
  REAL cos_val = (C1.r * C1.r + d * d - C2.r * C2.r) / (2 * C1.r * d);
  if (cos_val < -1 || 1 < cos_val) return {false, O, O};
  REAL t = acos(cos_val);
  REAL u = (B - A).angle();
  P X = A + P{C1.r * cos(u + t), C1.r * sin(u + t)};
  P Y = A + P{C1.r * cos(u - t), C1.r * sin(u - t)};
  return {true, X, Y};
}
#line 3 "/home/maspy/compro/library/geo/polygon.hpp"

template <typename T>
struct Polygon {
  vc<Point<T>> point;
  T a;

  Polygon(vc<Point<T>> point) : point(point) { build(); }

  int size() { return len(point); }

  template <typename REAL>
  REAL area() {
    return a * 0.5;
  }

  T area_2() { return a; }

  bool is_convex() {
    FOR(j, len(point)) {
      int i = (j == 0 ? len(point) - 1 : j - 1);
      int k = (j == len(point) - 1 ? 0 : j + 1);
      if ((point[j] - point[i]).det(point[k] - point[j]) < 0) return false;
    }
    return true;
  }

  // 中:1, 境界:0, 外:-1.
  int side(Point<T> p) {
    int n = len(point);
    FOR(i, n) if (point[i] == p) return 0;
    FOR(i, n) {
      Point<T> A = point[i], B = point[(i + 1) % n];
      if ((p - A).det(B - A) != 0) continue;
      if ((p - A).dot(B - A) >= 0 && (p - B).dot(A - B) >= 0) return 0;
    }
    // p から x 方向に (+1, +eps) 方向にのびる半直線との交差を考える
    int cnt = 0;
    FOR(i, n) {
      Point<T> A = point[i], B = point[(i + 1) % n];
      FOR(2) {
        swap(A, B);
        if (A.y > p.y) continue;
        if (B.y <= p.y) continue;
        if ((A - p).det(B - p) > 0) ++cnt;
      }
    }
    return (cnt % 2 == 0 ? -1 : 1);
  }

  // point[i] の近傍だけで見た side
  // https://github.com/maspypy/library/blob/main/geo/polygon_side.png
  int side_at(int i, Point<T> p) {
    int n = len(point);
    p -= point[i];
    if (p.x == T(0) && p.y == T(0)) return 0;
    Point<T> L = point[(i + 1) % n] - point[i];
    Point<T> R = point[(i + n - 1) % n] - point[i];
    auto sgn = [&](T x) -> int {
      if (x == T(0)) return 0;
      return (x > T(0) ? 1 : -1);
    };
    int x = sgn(L.det(p)) + sgn(p.det(R)) + sgn(R.det(L));
    if (x == 0) return x;
    return (x > 0 ? 1 : -1);
  }

  // 線分が内部・外部それぞれを通るか
  // https://atcoder.jp/contests/jag2016-domestic/tasks/jag2016secretspring_e
  // https://atcoder.jp/contests/JAG2014Spring/tasks/icpc2014spring_f
  pair<bool, bool> side_segment(Point<T> L, Point<T> R) {
    Segment<T> S(L, R);
    // まず線分と非自明に交わるパターン
    int n = len(point);
    FOR(i, n) {
      Segment<T> S2(point[i], point[(i + 1) % n]);
      if (count_cross(S, S2, false) == 1) { return {1, 1}; }
    }
    bool in = 0, out = 0;
    if (side(L) == 1 || side(R) == 1) in = 1;
    if (side(L) == -1 || side(R) == -1) out = 1;
    FOR(i, n) {
      if (!S.contain(point[i])) continue;
      for (auto& p: {L, R}) {
        int k = side_at(i, p);
        if (k == 1) in = 1;
        if (k == -1) out = 1;
      }
    }
    return {in, out};
  }

private:
  void build() {
    a = 0;
    FOR(i, len(point)) {
      int j = (i + 1 == len(point) ? 0 : i + 1);
      a += point[i].det(point[j]);
    }
    assert(a > 0);
  }
};
#line 7 "main.cpp"

/*
・辺に三角形をくっつける OR 凹な2辺に三角形をくつける
・ちょうど180度になった頂点を「消す」

くっつけるのは三角形だけでよさそう
順列順につけるだけだとだめです
*/

using Re = long double;
using P = Point<Re>;

// ???
const Re eps = 1e-10;

struct T {
  vc<P> point;
  vi edge_len;

  int size() { return len(point); }
  void rot() {
    rotate(point.begin(), point.begin() + 1, point.end());
    rotate(edge_len.begin(), edge_len.begin() + 1, edge_len.end());
  }
  void flip() {
    reverse(all(edge_len));
    // 0,1,2,3,4 -> 0,4,3,2,1
    reverse(point.begin() + 1, point.end());
    for (auto& p: point) p.y = -p.y;
  }
  void check() {
    int n = len(point);
    FOR(i, n) SHOW(point[i]);
    FOR(i, n) {
      P A = point[i];
      P B = point[(i + 1) % n];
      Re d = (B - A).dot(B - A);
      SHOW(d, edge_len[i]);
      assert(abs(d - edge_len[i]) < eps);
    }
  }
};

pair<bool, P> add_point(P A, P B, ll a, ll b) {
  // A から距離 a, B から距離 b, AB からみて右手側
  Circle<Re> C1(A, sqrtl(a));
  Circle<Re> C2(B, sqrtl(b));
  auto [ok, P, Q] = cross_point_circle<Re, Re>(C1, C2);
  if (!ok) return {false, A};
  FOR(2) {
    swap(P, Q);
    Re det = (P - A).det(B - A);
    if (det <= eps) continue;
    return {true, P};
  }
  return {false, A};
}

pair<bool, T> remove_extra(T t) {
  // 180度の頂点を削除
  int N = len(t);
  FOR(2 * N) {
    int n = len(t);
    t.rot();
    P A = t.point[0];
    P B = t.point[1];
    P C = t.point[2];
    Re det = (B - A).det(C - A);
    if (abs(det) > eps) continue;
    // B を削除??
    Re dot = (A - C).dot(A - C);
    ll c = round(dot);
    if (abs(dot / c - 1.0) > eps) return {false, t};
    T u;
    FOR(i, n) if (i != 1) u.point.eb(t.point[i]);
    u.edge_len.eb(c);
    FOR(i, 2, n) u.edge_len.eb(t.edge_len[i]);
    swap(t, u);
  }
  return {true, t};
}

bool check_square(T t) {
  int n = len(t);
  if (n != 4) return 0;
  if (MIN(t.edge_len) != MAX(t.edge_len)) return 0;
  // FOR(i, 4) SHOW(i, t.point[i].x, t.point[i].y);
  // SHOW(t.edge_len);
  // ひしがた
  P AB = t.point[1] - t.point[0];
  P BC = t.point[2] - t.point[1];
  Re dot = AB.dot(BC);
  return abs(dot) < eps;
}

bool dfs(vc<T> dat) {
  int K = len(dat);
  if (K == 1) return check_square(dat[0]);
  // FOR(k, K) { dat[k].check(); }

  auto last_two = [&](vc<T> dat) -> bool {
    T R = POP(dat);
    T L = POP(dat);
    int N = len(L), M = len(R);
    if (M != 3) return 0;
    vi S = R.edge_len;
    sort(all(S));

    do {
      ll a = S[0], b = S[1], c = S[2];
      // 辺の外部にくっつけるパターン
      FOR(N) {
        L.rot();
        if (L.edge_len[1] != c) continue;
#ifdef LOCAL
        if (c == 10) continue;
#endif
        P A = L.point[0], B = L.point[1];
        P C = L.point[2], D = L.point[3 % N];
        // L[1]->L[2] のところに
        auto [ok, p] = add_point(B, C, a, b);
        if (!ok) continue;
        /*
        雑チェック!
        まわりの辺との位置関係が大丈夫か?
        */
        Polygon<Re> poly(L.point);
        if (poly.side_at(1, p) == 1) continue;
        if (poly.side_at(2, p) == 1) continue;
        T nxt;
        FOR(i, 2) nxt.point.eb(L.point[i]);
        nxt.point.eb(p);
        FOR(i, 2, N) nxt.point.eb(L.point[i]);
        nxt.edge_len.eb(L.edge_len[0]);
        nxt.edge_len.eb(a);
        nxt.edge_len.eb(b);
        FOR(i, 2, N) nxt.edge_len.eb(L.edge_len[i]);
        tie(ok, nxt) = remove_extra(nxt);
        if (!ok) continue;
        // L.check();
        // nxt.check();
        dat.eb(nxt);
        if (dfs(dat)) return 1;
        POP(dat);
      }
      // 2辺にはり合わせるパターン
      FOR(N) {
        L.rot();
        P A = L.point[0], B = L.point[1], C = L.point[2];
        if (ccw(A, B, C) != -1) continue;
        if (L.edge_len[0] != a) continue;
        if (L.edge_len[1] != b) continue;
        Re x = (A - C).dot(A - C);
        if (abs(x / c - 1.0) > eps) continue;
        // 置き換え可能だとわかった
        T nxt;
        FOR(i, N) if (i != 1) nxt.point.eb(L.point[i]);
        nxt.edge_len.eb(c);
        FOR(i, 2, N) nxt.edge_len.eb(L.edge_len[i]);
        bool ok = 0;
        tie(ok, nxt) = remove_extra(nxt);
        if (!ok) continue;
        // L.check();
        // nxt.check();
        dat.eb(nxt);
        if (dfs(dat)) return 1;
        POP(dat);
      }
    } while (next_permutation(all(S)));
    return 0;
  };

  FOR(K) {
    rotate(dat.begin(), dat.begin() + 1, dat.end());
    FOR(K - 1) {
      rotate(dat.begin(), dat.begin() + 1, dat.end() - 1);
      if (last_two(dat)) return true;
    }
  }
  return false;
}

void solve() {
  vc<T> init;
  FOR(4) {
    LL(a, b, c);
    P A(0, 0);
    P B(sqrtl(c), 0);
    auto [ok, C] = add_point(A, B, a, b);
    assert(ok);
    T t;
    t.point = {B, A, C};
    t.edge_len = {c, a, b};
    init.eb(t);
  }
  // FOR(i, 4) init[i].check();
  print(dfs(init));
}

signed main() {
  INT(T);
  FOR(T) solve();
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 3656kb

input:

3
1 1 2
2 1 1
2 1 1
1 2 1
1 1 1
1 1 1
1 1 1
1 1 1
5 125 130
125 20 145
45 130 145
145 145 80

output:

1
0
1

result:

ok 3 lines

Test #2:

score: 0
Accepted
time: 10ms
memory: 3648kb

input:

20
1998001 7984010 9982009
1998001 7984010 1994005
7984010 9978013 9982009
9978013 1994005 7984010
9958045 7968034 9962037
7968034 1994005 9962037
9958045 1990013 7968034
1994005 1990013 7968034
7952074 9938097 1986025
7952074 9942085 1990013
7952074 9942085 9938097
1986025 7952074 1990013
7936130 9...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #3:

score: 0
Accepted
time: 4ms
memory: 3652kb

input:

20
1148639 3581051 1216206
9999916 7026968 270268
6013463 6013463 6756700
6013463 6013463 6756700
2608850 8630930 9445800
9862940 6448880 6939290
8631650 3682160 5184310
7504700 6652150 1917140
2359505 3170711 2299108
4027811 6760781 2960240
4679918 6106006 3178400
8153446 7975057 5222088
8849500 88...

output:

0
0
0
1
1
1
1
0
1
1
1
1
1
0
0
0
0
1
1
1

result:

ok 20 lines

Test #4:

score: 0
Accepted
time: 3ms
memory: 3652kb

input:

20
7300000 8100000 10000000
8100000 7300000 1000000
1000000 7300000 2900000
2900000 10000000 7300000
61728 8950560 9999936
7901184 4012320 4999968
8950560 3950592 4999968
4012320 123456 4999968
4494200 9932182 9932182
8381683 112355 9932182
5505395 9460291 9932182
9999595 4494200 9190639
5994936 671...

output:

1
1
0
0
0
1
0
0
0
0
0
1
1
0
0
0
0
1
0
0

result:

ok 20 lines

Test #5:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

20
10000000 5078125 3828125
78125 5000000 5078125
1250000 10000000 6250000
5000000 6250000 1250000
7079600 5663680 1415920
7079600 796455 9999935
5663680 9999935 5752175
5663680 88495 5752175
4410468 1135368 9999972
5676840 4541472 5676840
4541472 5676840 5676840
8078580 742356 6288192
8345560 44707...

output:

1
1
0
0
0
1
1
1
1
1
1
0
0
1
0
1
0
1
0
0

result:

ok 20 lines

Test #6:

score: 0
Accepted
time: 3ms
memory: 3716kb

input:

20
10000000 5078125 3828125
2031250 78125 1953125
703125 5078125 2031250
5000000 10000000 5000000
5000000 10000000 5000000
5000000 2890625 390625
6250000 1250000 10000000
1250000 2890625 3515625
6711400 9999986 3288586
4899322 4295296 604026
6979856 9999986 4899322
6711400 6979856 268456
9767552 645...

output:

1
1
1
0
1
1
0
1
1
0
1
1
0
0
1
0
0
1
0
0

result:

ok 20 lines

Test #7:

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

input:

20
3063559 8439238 9999919
3063559 9999919 3005756
8381435 9999919 8439238
8381435 3005756 9999919
6923007 4319483 4852022
2130156 4319483 769223
9999899 3076892 6923007
6923007 2899379 4852022
3271584 4999968 493824
6049344 61728 5246880
4999968 4999968 9999936
5246880 3271584 3950592
7398784 99999...

output:

1
1
1
1
0
1
0
0
1
0
0
0
0
1
0
0
0
1
0
0

result:

ok 20 lines

Test #8:

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

input:

20
5524800 4475088 9999888
55248 4475088 4530336
9999888 5580048 5524800
55248 4530336 5580048
7123920 8940020 2698748
6206580 7677584 8296048
6252164 6473284 9023920
7524124 4702788 5944204
7901120 7901120 6320896
6320896 7901120 7901120
9135670 9999855 913567
1506151 1111095 98764
2222220 3555552 ...

output:

1
0
0
1
0
1
1
0
0
1
1
1
1
1
0
1
0
0
1
0

result:

ok 20 lines

Test #9:

score: 0
Accepted
time: 3ms
memory: 3756kb

input:

20
3404348 6811514 5073762
1575108 4047618 3481696
6589302 6594868 4559458
5124278 2664770 3517574
5393960 2157584 5393960
5393960 2157584 5393960
2199076 9999572 2821456
2157584 8972645 8723693
2091488 4248335 9999927
9999927 9542414 7385567
4248335 9542414 9999927
9999927 2091488 7385567
5867350 7...

output:

0
0
1
0
1
0
1
1
0
1
1
0
1
0
1
1
0
1
0
1

result:

ok 20 lines

Test #10:

score: 0
Accepted
time: 4ms
memory: 3724kb

input:

20
4753532 8244880 6269438
3937444 762818 4555348
7280126 5303718 8327606
9077712 1705788 9903866
4999968 9999936 4999968
555552 7222176 9999936
6543168 1543200 4999968
7222176 6543168 61728
1360000 6560000 3664000
6560000 6560000 4608000
10000000 2960000 6560000
1152000 2320000 3664000
1709400 5470...

output:

0
1
0
0
1
0
1
1
0
0
1
1
1
1
0
1
0
1
0
0

result:

ok 20 lines

Test #11:

score: 0
Accepted
time: 4ms
memory: 3644kb

input:

20
2615382 9846144 9999990
9846144 9999990 9999990
9999990 2769228 2615382
9999990 2769228 9999990
9191125 9999944 4779385
1323522 9191125 6544081
6544081 9999944 9191125
1323522 9191125 4779385
7028892 1743768 1991340
7028892 7028892 1743768
8234460 4865328 7028892
2378844 7599384 9999756
9731530 4...

output:

1
1
0
1
1
1
0
0
1
0
0
0
1
1
1
1
0
1
1
1

result:

ok 20 lines

Test #12:

score: 0
Accepted
time: 3ms
memory: 3656kb

input:

20
4999960 6173420 3316300
4999960 4999960 9999920
459180 459180 918360
1632640 459180 3316300
6328125 5078125 156250
5078125 6328125 10000000
6328125 5078125 10000000
6328125 156250 5078125
9979836 8089680 8280504
7601784 7634364 7141536
5377824 7028244 4492560
5815068 7928868 4377312
720000 800000...

output:

1
1
0
1
0
0
1
1
0
0
1
1
0
0
1
1
1
1
0
1

result:

ok 20 lines

Test #13:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

20
9999916 1689175 5743195
5743195 878371 4999958
9999916 4999958 4999958
1689175 878371 4999958
6301605 4049556 6301605
2024778 4049556 2024778
7293333 330576 6301605
9999924 6115656 3388404
617280 7901184 6543168
617280 123456 987648
4999968 4999968 9999936
1543200 6543168 4999968
3828125 1953125 ...

output:

1
0
1
1
0
1
1
1
1
0
1
0
0
1
0
0
0
0
0
1

result:

ok 20 lines

Test #14:

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

input:

20
9999720 2888808 3555456
7610898 3555456 7610898
4944306 8805309 1805505
7610898 7610898 3555456
4999968 4999968 9999936
6543168 1543200 2530848
987648 9999936 6543168
1543200 987648 2530848
4999967 2358475 5471662
754712 5471662 9999934
754712 4999967 2358475
4999967 9999934 4999967
5371860 20661...

output:

0
1
1
0
0
1
1
1
0
1
0
0
1
0
1
1
1
1
1
0

result:

ok 20 lines

Test #15:

score: 0
Accepted
time: 3ms
memory: 3684kb

input:

20
4999968 4999968 9999936
4999968 5555520 555552
5555520 3402756 1180548
1180548 2222208 1736100
2207678 4505792 4722268
6840476 4330164 8510736
5829672 8496568 9904306
4191336 5368108 9200414
2644740 821072 2890020
3199420 6624380 4992680
6593608 7493780 2880304
9678732 5684644 8431388
9999920 433...

output:

1
0
0
1
0
0
0
1
1
0
1
1
1
1
0
1
0
1
1
0

result:

ok 20 lines

Test #16:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

20
8136144 6408528 8054156
7239584 6536596 1012996
1884652 5391096 6567204
1480764 5442988 5704872
9999936 4999968 4999968
902772 5069412 6944400
4999968 902772 5069412
3611088 4999968 277776
6358573 6634433 717236
2110329 2013778 1558609
9737858 9999925 6634433
717236 6634433 6634433
8820735 572387...

output:

0
1
0
0
0
1
1
0
0
0
1
1
1
0
1
0
1
1
1
0

result:

ok 20 lines

Test #17:

score: 0
Accepted
time: 4ms
memory: 3744kb

input:

20
1479580 2551000 2499980
1479580 5408120 2499980
4999960 9999920 4999960
408160 5408120 4999960
1418208 6119592 6943616
4717024 1703128 4933672
8516320 2379048 9953024
6649448 9056784 2567000
6639370 1661665 8301033
6639370 8297389 8301033
1658021 6639370 1661665
8297389 6639370 1658021
8390964 71...

output:

1
0
1
0
0
1
0
1
0
1
1
0
0
0
0
0
0
1
0
1

result:

ok 20 lines

Test #18:

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

input:

20
7346880 3775480 2551000
408160 3775480 3775480
4999960 3775480 204080
4999960 9999920 4999960
1493307 3497157 3289248
8523972 9198432 4312377
9709335 6351264 6294204
6821208 8165214 7286535
3024672 1543200 1111104
4999968 5246880 246912
4444416 5246880 1543200
4999968 4999968 9999936
3773520 1886...

output:

1
0
1
0
0
0
1
0
1
0
0
1
1
0
0
0
1
0
1
1

result:

ok 20 lines

Test #19:

score: 0
Accepted
time: 4ms
memory: 3620kb

input:

20
2352936 2941170 9999978
6522477 1470585 8062266
9999978 4999989 4999989
1245672 4999989 1470585
816320 1326520 1734680
4999960 9999920 4999960
5306080 2653040 2653040
5306080 1020400 9999920
1592350 9745182 5222908
5222908 9999958 9745182
6369400 9745182 1592350
6369400 9745182 9999958
5103567 38...

output:

0
0
1
0
1
0
1
0
1
1
1
1
1
0
1
0
1
1
1
1

result:

ok 20 lines

Test #20:

score: 0
Accepted
time: 3ms
memory: 3656kb

input:

20
7799454 2234856 7068594
7469592 6119295 2577003
5131074 5574153 788268
9870705 8852376 4653597
5475555 487800 2695095
6158475 4938975 9999900
2756070 6890175 6890175
2756070 6890175 6890175
800000 400000 400000
5000000 10000000 5000000
5000000 6800000 1800000
6800000 400000 6400000
9999916 844587...

output:

0
0
1
0
0
0
0
0
1
0
1
0
1
1
0
1
1
0
1
0

result:

ok 20 lines

Test #21:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

20
8237460 1860180 7272027
4902072 8849757 8065575
3965220 5917359 3180429
3014466 9630789 9316083
7918794 5678634 9874566
2886624 5180292 7598136
4464798 1190046 4641780
1591902 1488552 2232360
5111680 7316092 1437660
5111680 4089344 5111680
5111680 5239472 1661296
3610124 1661296 9999724
10000000 ...

output:

0
0
0
1
1
1
1
1
0
1
1
1
1
1
0
0
0
0
0
0

result:

ok 20 lines

Test #22:

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

input:

20
1938141 7950042 2037501
9986301 2037501 7950042
1938141 7950042 9886941
9986301 9886941 7950042
8268288 8041242 2564520
9467202 6784944 8153346
7401474 5033406 4490748
9289506 9273174 3531036
1780818 4999989 890409
4999989 1780818 5821905
9999978 890409 5821905
9999978 4999989 4999989
9999909 269...

output:

1
0
1
1
1
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0

result:

ok 20 lines

Test #23:

score: 0
Accepted
time: 4ms
memory: 3708kb

input:

20
2416104 6711400 9127504
1677850 9999986 9127504
1073824 604026 1677850
6711400 3288586 9999986
7352800 8602776 2720536
5974150 5974150 919100
919100 5974150 5974150
5441072 9999808 1911728
9392195 5013150 8219905
5548800 4903200 1000450
5186040 4242970 3048285
4759225 2184840 5285745
8648640 7837...

output:

1
0
0
1
0
0
1
0
1
1
0
1
1
0
0
0
1
1
1
0

result:

ok 20 lines

Test #24:

score: 0
Accepted
time: 3ms
memory: 3628kb

input:

20
5102000 9999920 3673440
9999920 5408120 8265240
5408120 2551000 9999920
5102000 9999920 6530560
5000000 5000000 10000000
3200000 5000000 8200000
8100000 200000 6500000
6500000 100000 8200000
4999968 4999968 9999936
9999936 2777760 2777760
694440 2777760 1249992
6249960 1249992 4999968
9999990 345...

output:

1
1
1
1
1
1
1
0
0
1
0
1
0
0
1
1
0
1
0
0

result:

ok 20 lines

Test #25:

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

input:

20
2461536 9999990 7538454
1384614 3846150 2461536
3846150 8923068 1384614
8923068 7538454 9999990
7123272 7260258 9999978
7123272 684930 3424650
7123272 684930 7260258
9999978 7123272 3424650
6512715 8851305 6485040
8758230 3115170 9438570
8690730 8032245 8359425
1004070 4133535 3833130
4226690 455...

output:

1
1
0
0
1
1
0
0
1
0
1
1
1
0
0
0
0
1
0
1

result:

ok 20 lines

Test #26:

score: 0
Accepted
time: 3ms
memory: 3628kb

input:

20
5408120 2040800 918360
9999920 2551000 5408120
4999960 9999920 4999960
2040800 1632640 408160
10000000 2000000 4000000
8000000 1000000 5000000
8000000 1000000 5000000
5000000 5000000 10000000
8005300 8476200 8005300
9002500 9418000 138500
8545450 9999700 124650
8005300 8005300 8476200
138888 3611...

output:

1
0
0
1
0
1
1
0
1
0
1
1
1
0
1
1
1
1
0
0

result:

ok 20 lines

Test #27:

score: 0
Accepted
time: 3ms
memory: 3612kb

input:

20
4062500 8562500 10000000
10000000 7062500 8562500
1125000 8562500 7062500
4062500 8562500 1125000
80000 5920000 5200000
10000000 5200000 5920000
4880000 5920000 80000
5920000 4880000 10000000
9717868 4645503 5521328
2311012 5378917 4137074
5021909 7490649 3000224
3284516 9148277 9904852
6249960 1...

output:

1
1
0
1
0
0
1
1
0
1
1
1
1
0
0
0
0
0
0
0

result:

ok 20 lines

Test #28:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

20
6697128 8053596 6626364
6595068 8455992 2604024
2944560 7228524 6327096
3293904 9652152 8723208
4999968 9999936 4999968
3950592 6975264 3024672
8950560 61728 9999936
246912 8950560 6975264
3340602 5873346 5676840
5698674 5676840 5873346
9192114 109170 9999972
5676840 5676840 349344
987648 9999936...

output:

0
1
0
1
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #29:

score: 0
Accepted
time: 3ms
memory: 3720kb

input:

20
4000000 4000000 8000000
2000000 4000000 10000000
6250000 8000000 4250000
4250000 6250000 8000000
9999900 3388855 8722135
1444430 8055475 8722135
8722135 1444430 3388855
8055475 8722135 9999900
3472200 4999968 8472168
4999968 9999936 4999968
8472168 7013844 69444
8402724 138888 7013844
5078125 382...

output:

0
1
1
1
1
1
1
0
1
0
1
0
1
0
0
0
0
0
1
1

result:

ok 20 lines

Test #30:

score: 0
Accepted
time: 3ms
memory: 3736kb

input:

20
4429593 9626788 5758165
4904957 9545943 6959708
6061466 7740834 9999227
3923639 3937370 4963055
555555 1888887 1999998
4999995 4999995 9999990
1888887 4999995 888888
5555550 9999990 2222220
5850721 1168921 4681802
4681802 5853781 5850721
1168921 4681802 1171981
1171981 4681802 5853781
5783446 690...

output:

0
1
1
0
1
1
1
1
1
1
1
0
1
1
0
1
1
0
1
0

result:

ok 20 lines

Test #31:

score: 0
Accepted
time: 3ms
memory: 3664kb

input:

20
8167204 2726396 7607640
8207368 5094088 7237940
1889236 7349680 6598032
6603544 5909552 958016
6210068 7765074 7760090
1550026 6210068 1555010
6210068 1555010 7765074
6210068 7760090 1550026
5429512 7620976 5462464
6599536 8481440 6328256
7162360 2183840 5749896
9404016 2898312 6519784
1250000 62...

output:

0
1
0
1
0
1
0
0
0
0
0
0
0
1
1
1
1
0
1
0

result:

ok 20 lines

Test #32:

score: 0
Accepted
time: 3ms
memory: 3932kb

input:

20
6523290 9097503 4079184
6827124 3909657 8150730
9359829 3267423 8627997
4426740 5483787 5447796
9999978 616437 8561625
136986 1712325 1164381
4999989 4999989 9999978
3561636 1712325 4999989
8234065 6194559 9058630
1121694 8650236 7664083
5065445 7707455 4411981
7179879 8934331 6849311
8622380 499...

output:

0
0
0
1
1
0
0
1
1
1
1
1
1
0
1
0
1
1
0
1

result:

ok 20 lines

Test #33:

score: 0
Accepted
time: 4ms
memory: 3676kb

input:

20
4900000 6500000 10000000
2000000 10000000 8000000
900000 6500000 8000000
10000000 2000000 8000000
1340196 2113386 4999962
4999962 9999924 4999962
3350490 9999924 2113386
4999962 3350490 1340196
1538460 3076920 1538460
1538460 1538460 3076920
3076920 9999990 6923070
6538455 6538455 6923070
7369375...

output:

1
1
0
0
0
1
1
0
1
0
1
1
0
1
1
1
0
1
0
1

result:

ok 20 lines

Test #34:

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

input:

20
5050000 5000000 50000
4050000 10000000 5050000
10000000 4050000 5050000
50000 5000000 5050000
3157376 2383608 2783496
1157736 9716360 8996032
9974976 1892728 9114840
9468728 7768808 3929312
9999900 9388795 55555
9999900 7999920 9999900
7999920 9999900 1999980
7999920 9388795 1388875
6192540 96655...

output:

1
0
1
0
1
0
0
0
1
0
1
1
1
1
0
1
0
0
1
0

result:

ok 20 lines

Test #35:

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

input:

20
5703125 9453125 10000000
3203125 781250 1328125
5078125 5078125 312500
312500 5078125 5078125
9999958 6624176 4140110
4140110 3694252 9999958
3694252 6178318 9999958
6624176 9999958 6178318
3400000 5000000 6400000
650000 1250000 3400000
400000 650000 1250000
5000000 10000000 5000000
9999990 70270...

output:

0
1
1
1
1
1
0
0
1
0
0
1
0
0
0
0
0
0
1
1

result:

ok 20 lines

Test #36:

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

input:

20
9127504 67114 9999986
5436234 7315426 9127504
3288586 9999986 6711400
7315426 604026 6711400
9999730 2113345 9082229
876265 6030765 5546242
3267953 3267953 6535906
3267953 3267953 6535906
2776952 6029980 7963024
3535344 5766468 6862516
9188688 7211432 8982368
7021980 4055432 8635460
2001039 79903...

output:

1
0
0
1
0
0
1
0
0
1
0
0
0
1
1
0
1
1
0
1

result:

ok 20 lines

Test #37:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

20
1145400 5280294 4134894
4318158 9999342 3115488
4134894 5280294 1145400
1145400 7067118 9495366
5655130 4413760 8965450
68965 5586165 5655130
4413760 5586165 9999925
68965 9999925 8965450
4553812 1599988 1230760
7692250 7692250 9969156
3076900 7692250 7692250
615380 9999925 9999925
7200000 400000...

output:

0
1
0
0
1
1
0
1
0
1
0
1
1
1
1
1
1
0
0
1

result:

ok 20 lines

Test #38:

score: 0
Accepted
time: 4ms
memory: 3636kb

input:

20
5517200 841373 6579261
3048253 3048253 5517200
882752 7793045 9999925
5517200 2206880 5517200
6093648 3476682 7214220
7694730 8118792 4621698
6785964 1639044 7765416
9952164 3722814 9112608
4999968 9999936 4999968
493824 308640 61728
308640 3271584 3950592
4999968 3271584 6049344
1230768 9999990 ...

output:

0
0
1
1
1
0
1
0
0
1
1
0
1
1
0
1
1
1
0
0

result:

ok 20 lines

Test #39:

score: 0
Accepted
time: 4ms
memory: 3660kb

input:

20
9839013 7987003 9379770
2923212 5452881 7179769
5340680 9840181 9911721
4682074 3286387 1728129
2936340 7846553 1582361
4437136 5546420 5546420
4437136 5546420 5546420
81565 9999869 9559418
9999608 4938331 1741735
9118495 9118495 9917644
1331915 9118495 4098200
9384878 9118495 4938331
9999990 351...

output:

0
0
0
1
0
1
1
0
1
0
0
1
0
0
1
0
0
0
1
1

result:

ok 20 lines

Test #40:

score: 0
Accepted
time: 3ms
memory: 3648kb

input:

20
1436448 1381200 55248
5524800 9999888 5580048
4475088 9999888 5524800
1381200 1436448 5580048
6450765 544815 6138891
7237605 3329589 6066864
4363101 5144037 7808493
4928364 2961654 4298961
9999925 7310290 620685
68965 5586165 5655130
1724125 7310290 5586165
5586165 9999925 5655130
268456 7315426 ...

output:

1
0
1
1
1
0
1
0
1
1
1
1
1
0
1
0
0
0
0
1

result:

ok 20 lines

Test #41:

score: 0
Accepted
time: 2ms
memory: 3624kb

input:

20
5524800 9999888 4475088
55248 276240 220992
5580048 9999888 5524800
5580048 3535872 276240
8358624 7783808 8482560
9611696 9963920 4555200
9934560 7872720 2100992
3301616 6141360 5774720
5882350 117647 5764703
5882350 470588 5882350
5882350 9999995 2941175
5764703 9999995 4235292
3828125 10000000...

output:

1
0
1
1
1
1
1
0
0
1
0
0
0
0
0
1
0
0
1
0

result:

ok 20 lines

Test #42:

score: 0
Accepted
time: 4ms
memory: 3732kb

input:

20
8413730 7517185 1172405
3655145 1172405 8413730
9999925 7517185 8413730
9999925 8413730 3655145
3049221 5789007 3276630
7254450 6439629 7215348
5303907 8654625 8396640
3786279 9997323 6576780
5791744 1855168 6922944
8054144 8370880 9999808
1312192 8054144 8370880
904960 8370880 8370880
8648640 60...

output:

1
0
0
0
0
0
0
0
0
1
0
1
1
0
1
1
1
1
0
0

result:

ok 20 lines

Test #43:

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

input:

20
8950560 1543200 5555520
9999936 61728 8950560
555552 5555520 4999968
4999968 9999936 4999968
6129440 7661800 7661800
700130 9999970 7661800
9999970 7661800 2391010
3659170 6129440 2073970
6593178 8406564 4161354
6593178 6593178 1551336
9999828 429762 8857290
1436034 8406564 6593178
5703125 500000...

output:

1
0
0
1
0
0
0
0
1
0
1
0
0
1
1
0
1
1
1
0

result:

ok 20 lines

Test #44:

score: 0
Accepted
time: 4ms
memory: 3736kb

input:

20
9024374 4878040 1219510
6341452 1219510 9024374
9024374 9999982 6341452
9999982 9024374 4878040
9999909 7668324 4196853
7668324 673569 6476625
7668324 6476625 9999909
673569 4196853 7668324
3665249 4878624 3698938
6292991 2721386 5806499
5463899 6720670 9985648
1567395 7375607 6991324
4584474 401...

output:

1
1
0
0
1
1
0
0
0
0
0
0
0
1
1
1
0
0
0
1

result:

ok 20 lines

Test #45:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

20
4999968 3124980 5624964
624996 1180548 2222208
1180548 555552 3124980
9999936 4999968 4999968
7258188 4658488 4181172
6066112 6965856 8440748
3792136 2014244 4868492
8721784 8136496 953768
7744040 9671220 9688820
9671220 1927220 7744040
1944820 7744040 9688820
1927220 1944820 7744040
9464840 6623...

output:

1
0
1
0
1
1
0
0
1
0
1
1
0
0
0
0
0
1
1
0

result:

ok 20 lines

Test #46:

score: 0
Accepted
time: 4ms
memory: 3756kb

input:

20
7641459 1509424 9150883
9150883 7641459 9999934
9999934 5754679 849051
3396204 5754679 2358475
2656250 1406250 5000000
2031250 2656250 1250000
5000000 10000000 5000000
2031250 1250000 3906250
7123272 7465737 68493
7465737 273972 8561625
7465737 9999978 6095877
7465737 7123272 7739709
9999808 1809...

output:

1
1
0
0
0
1
1
0
0
1
0
0
1
0
1
0
0
0
0
0

result:

ok 20 lines

Test #47:

score: 0
Accepted
time: 4ms
memory: 3752kb

input:

20
9999920 1632640 5918320
4999960 2499980 2499980
4999960 2499980 2499980
918360 4999960 5918320
6289250 3917125 3077000
6578625 4040625 9055625
7493250 8998625 9566375
9241625 9958250 8263000
6778514 604026 6979856
6778514 9999986 4295296
3288586 6711400 9999986
6711400 268456 6979856
5154672 8064...

output:

1
0
1
0
0
1
0
0
0
0
0
0
1
1
0
0
0
0
0
0

result:

ok 20 lines

Test #48:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

20
4999960 2959160 5102000
2959160 2040800 102040
2040800 3673440 816320
4999960 4999960 9999920
8969670 4393918 5470836
8245742 5980472 8380576
4854342 6541344 7095586
7361178 5224256 5629230
8865150 2769564 7870506
8055978 967659 8979075
6637365 8353338 8551704
4009866 6193257 9943689
1111104 4999...

output:

1
0
0
1
1
1
0
0
1
1
1
1
0
0
1
0
0
1
0
1

result:

ok 20 lines

Test #49:

score: 0
Accepted
time: 4ms
memory: 3640kb

input:

20
1867515 7500030 1882515
7500030 9382515 1882515
7500030 1867515 9367515
9382515 9367515 7500030
5050000 10000000 4050000
5000000 50000 5050000
6250000 1250000 5000000
6250000 1250000 10000000
3611088 277776 4999968
5624964 3124980 4999968
9999936 4999968 4999968
69444 3124980 3611088
9422883 4232...

output:

1
1
1
0
1
0
0
1
1
1
0
0
0
0
0
0
1
1
1
0

result:

ok 20 lines

Test #50:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

20
1156721 4620802 5777521
4620802 5774481 1153681
4620802 1156721 1153681
5774481 5777521 4620802
9915021 9439947 8061660
3594834 7962273 6274683
8329788 8252766 5070951
7155486 3029796 7445997
5360916 8156406 6062454
9490806 392394 9826470
4967088 6125268 5921634
9754710 6159942 9613632
8397191 73...

output:

1
0
0
0
0
1
0
1
0
0
0
0
1
1
0
1
0
1
0
0

result:

ok 20 lines

Test #51:

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

input:

20
3106092 5207532 2782692
8017416 3208656 4903668
4315476 7218816 3266208
5090316 9940524 6990588
4999960 4999960 9999920
6632600 663260 4132620
1632640 4999960 6632600
663260 1275500 918360
4207840 9999808 4009824
4207840 8415680 4207840
8910720 8415680 8415680
2227680 7326592 1831648
5762832 8699...

output:

0
1
0
0
0
0
1
1
1
1
1
1
1
0
0
1
1
0
0
0

result:

ok 20 lines

Test #52:

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

input:

20
7009848 9932352 3128850
7528620 9992124 6966600
9447240 2585394 7867362
6969762 6259332 8607168
9235630 3375782 8662384
3121006 9999958 7770668
9235630 8662384 7452198
9235630 127388 9235630
2500000 5000000 2500000
2500000 2656250 156250
1406250 5000000 2656250
5000000 10000000 5000000
9999900 61...

output:

0
0
1
1
0
0
0
1
1
0
0
1
0
1
0
1
0
1
0
1

result:

ok 20 lines

Test #53:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

20
3627925 9668450 8942550
4472775 2834950 6152450
9650000 6508175 9445100
8029975 6006475 9850625
5764703 5882350 117647
5882350 1882352 6823526
5764703 4235292 9999995
9999995 6823526 1058823
9999828 3207492 7547040
424521 3065985 3207492
6886674 4622562 7547040
7547040 3773520 3773520
9189180 999...

output:

0
1
0
1
1
0
1
1
1
1
0
1
0
1
0
1
0
1
1
0

result:

ok 20 lines

Test #54:

score: 0
Accepted
time: 4ms
memory: 3640kb

input:

20
1001113 4010114 5011225
5014057 4010114 5011225
1001113 1003945 4010114
4010114 5014057 1003945
5199022 3354662 6735676
3184656 2786790 1710190
1403138 1350132 299630
1672886 4952652 5281468
6446766 7285743 8009076
4264479 5848485 3067731
959706 2097465 1309434
3320592 5158725 3667110
6267888 761...

output:

1
0
0
0
0
1
0
0
1
0
0
1
1
0
0
1
1
1
1
0

result:

ok 20 lines

Test #55:

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

input:

20
6898750 3188990 4202515
8393625 3569340 6355135
4416160 6588475 3692770
5118275 6329355 1616095
5764703 117647 5882350
5882350 5764703 9999995
4235292 9999995 4352939
4235292 4352939 117647
600444 6119910 9999702
8371575 8371575 6697260
5103774 1443375 9202959
6697260 8371575 8371575
4847666 5690...

output:

0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
1
1
0

result:

ok 20 lines

Test #56:

score: 0
Accepted
time: 3ms
memory: 3688kb

input:

20
1406250 5000000 2656250
3906250 5000000 2656250
5000000 703125 5703125
5703125 1953125 10000000
6127118 289015 6531739
6531739 9999919 6127118
4161816 6531739 9999919
6531739 4161816 289015
1115868 4999947 5944143
9999894 4999947 4999947
5944143 9999894 1394835
2167359 557934 4914111
3630129 4452...

output:

1
1
0
0
1
1
0
0
1
1
1
1
0
1
0
1
1
1
1
0

result:

ok 20 lines

Test #57:

score: 0
Accepted
time: 3ms
memory: 3872kb

input:

20
8524568 819670 9999974
2622944 5901624 8524568
655736 819670 163934
5901624 4098350 9999974
9964800 9904248 4863312
9503856 2709612 7760448
5414004 6643872 9138168
9767052 5510808 9727632
3610124 1661296 9999724
5239472 5111680 1661296
5111680 4089344 5111680
5111680 7316092 1437660
3125000 62500...

output:

1
0
0
0
0
0
1
1
0
1
0
0
1
0
1
1
1
1
0
1

result:

ok 20 lines

Test #58:

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

input:

20
2777775 4999995 6444438
9999990 4999995 4999995
444444 9999990 6444438
2777775 444444 4999995
6410366 6104350 4502066
7045156 861480 7119336
4544534 6840520 5970408
7199410 4531826 3943932
5221580 4776083 7922460
2392468 1927770 1541865
4212754 5678868 6123195
9600604 6694792 8890986
1300000 8000...

output:

1
0
0
1
1
0
1
0
1
1
1
0
1
0
1
1
0
0
0
0

result:

ok 20 lines

Test #59:

score: 0
Accepted
time: 7ms
memory: 3664kb

input:

20
3814404 3505128 9999924
9999924 3814404 7010256
7010256 9999924 6700980
9999924 3505128 6700980
8330784 6906900 361284
7321314 6906900 5408634
5408634 786324 9999066
6906900 6800640 6906900
6721470 4286808 9372792
8648514 6413136 2967816
7658022 9750222 8195184
8728704 7855404 9235140
4760264 188...

output:

1
0
0
0
1
1
1
1
1
0
1
1
0
1
0
1
0
0
1
0

result:

ok 20 lines

Test #60:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

20
4705872 1470585 8529393
294117 1176468 1470585
2647053 7352925 9999978
7352925 9999978 8529393
1396080 2897312 1873216
5988944 6999544 8556192
9162120 3746112 9058960
7213824 8013440 8595392
8287653 9999978 1712325
3356157 2465748 5821905
1095888 8287653 9383541
9999978 9383541 5821905
9999900 39...

output:

1
0
1
0
0
1
1
0
1
0
1
1
0
0
0
0
1
0
0
1

result:

ok 20 lines

Test #61:

score: 0
Accepted
time: 2ms
memory: 3736kb

input:

20
7252758 5512254 8117464
5913822 7345912 8551838
8387808 9915684 6184260
3946026 7169192 3566830
4454411 4283734 5823519
1049724 9821279 9243637
6313307 4663711 7974863
6077435 5788302 6667180
5456711 5456711 2469100
4197470 1111095 3086375
9728254 1506151 9999855
3086375 4197470 1111095
4268992 2...

output:

0
0
0
0
1
1
0
1
1
0
0
1
0
1
0
1
1
1
0
1

result:

ok 20 lines

Test #62:

score: 0
Accepted
time: 4ms
memory: 3680kb

input:

20
9999990 1837836 6108102
9999990 1837836 5459454
5459454 9999990 9729720
6108102 9729720 9999990
7601000 6447518 3091506
8743328 9635648 8412096
3408680 4567904 4803810
7368108 9933638 9045674
2995146 9068208 8752188
5267568 6185154 7249194
3173274 9898914 7581510
5894826 8327130 5040708
9763726 1...

output:

1
0
0
0
1
1
1
0
0
0
0
1
1
0
1
1
1
0
0
0

result:

ok 20 lines

Test #63:

score: 0
Accepted
time: 3ms
memory: 3612kb

input:

20
7222202 555554 5555540
5555540 1388885 6944425
2777770 9444418 9999972
7222202 5555540 555554
9997662 2707403 8236305
7587384 7035920 9436690
7516074 3648695 9477099
7111984 3375340 7599269
5782539 6319460 1114771
9016112 6717627 6668305
3123624 7689661 8119517
5757430 493269 5700968
4999958 9999...

output:

0
0
0
0
0
0
0
0
0
1
1
0
0
1
0
1
0
0
0
1

result:

ok 20 lines

Test #64:

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

input:

20
4999991 121951 4146334
4999991 9999982 4999991
9999982 3902432 4146334
3902432 4999991 121951
9999936 4999968 4999968
1543200 4999968 3209856
9999936 2098752 3209856
2098752 4999968 1543200
5200000 200000 5000000
2500000 4900000 3200000
10000000 5000000 5000000
900000 2500000 5200000
7221708 7958...

output:

1
1
1
0
1
1
1
0
1
0
0
0
1
1
0
0
0
0
1
1

result:

ok 20 lines

Test #65:

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

input:

20
6923070 307692 8153838
1923075 8153838 6230763
9999990 1230768 6923070
6230763 3769227 9999990
3960360 8811801 9999909
8811801 3960360 1287117
9999909 7326666 8811801
7326666 8811801 1287117
5029535 6923007 7692230
6923007 5029535 946736
4792851 769223 7692230
3076892 9999899 6923007
3076920 9999...

output:

1
1
1
1
0
0
1
0
1
1
0
1
0
0
1
0
0
0
1
1

result:

ok 20 lines

Test #66:

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

input:

20
6097500 9999900 3902400
6097500 6341400 9999900
243900 1768275 1524375
6341400 1524375 1768275
9999990 9135126 7891884
9135126 3675672 9999990
1567566 9135126 7891884
9135126 3675672 1567566
8620275 101415 8843388
8620275 2028300 8620275
8620275 3022167 8843388
9999519 6754239 9451878
2482048 309...

output:

1
1
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
1
0

result:

ok 20 lines

Test #67:

score: 0
Accepted
time: 4ms
memory: 3752kb

input:

20
5574387 9881352 8047338
8272992 6490614 3024957
6374784 3285087 7590648
8271705 1768845 7850544
9999900 4999950 4999950
4999950 55555 4055515
8722135 55555 9999900
4999950 4055515 8722135
4549518 1039230 9607104
6004440 7390080 6004440
4272390 9999702 1200888
6004440 7390080 6004440
9761893 97618...

output:

0
1
0
0
1
0
0
1
1
0
1
0
0
0
0
0
0
1
1
1

result:

ok 20 lines

Test #68:

score: 0
Accepted
time: 4ms
memory: 3620kb

input:

20
703125 10000000 6953125
1953125 6953125 5000000
2812500 5312500 10000000
5312500 312500 5000000
8856170 4527695 7960625
4939480 2468300 4519875
5074385 6548440 7895830
7729905 3625760 6679945
4734576 2954844 4698000
3756636 5989032 3648600
6396264 7826724 5434776
6155928 4112928 9902520
9578500 3...

output:

1
0
0
0
1
1
0
1
0
1
1
0
1
1
1
1
0
1
0
0

result:

ok 20 lines

Test #69:

score: 0
Accepted
time: 3ms
memory: 3600kb

input:

20
2866064 5194741 5194741
2297066 3582580 273962
9999613 948330 7723621
2866064 5194741 5194741
5965806 5538456 427350
8905974 4444440 5965806
9880332 9999990 1726494
427350 5965806 4444440
8673400 4999960 3673440
8673400 4183640 816320
102040 5102000 4183640
9999920 4999960 4999960
6923070 9999990...

output:

0
0
1
1
1
0
1
1
0
0
0
0
0
1
0
0
1
1
1
1

result:

ok 20 lines

Test #70:

score: 0
Accepted
time: 3ms
memory: 3852kb

input:

20
5061696 4999968 61728
987648 6543168 5061696
987648 6543168 9999936
4999968 9999936 4999968
9999958 3184700 9999958
7706974 9999958 2292984
9999958 2292984 7706974
1592350 1592350 3184700
6377500 408160 8622380
4999960 2551000 7550960
51020 7550960 6377500
4999960 4999960 9999920
3542984 3555432 ...

output:

1
1
1
0
0
1
1
1
1
0
0
1
0
0
1
1
0
0
1
0

result:

ok 20 lines

Test #71:

score: 0
Accepted
time: 4ms
memory: 3840kb

input:

20
9999917 9796873 8629370
2284245 2081201 8629370
9796873 8629370 2081201
8629370 9999917 2284245
2013876 4999968 1180548
4999968 9999936 4999968
9999936 4513860 1180548
4999968 2013876 4513860
9999990 4999995 4999995
2777775 4444440 555555
2222220 4999995 7222215
1111110 2777775 7222215
9289847 99...

output:

1
1
1
1
1
0
0
0
0
1
1
1
1
0
0
1
0
1
1
1

result:

ok 20 lines

Test #72:

score: 0
Accepted
time: 4ms
memory: 3588kb

input:

20
3869265 6313801 4657409
7246591 9638675 8080553
9695932 7849665 3432630
4760019 4281596 1911925
2000000 3600000 3200000
5200000 2000000 1600000
10000000 5000000 5000000
5200000 200000 5000000
1964955 5758680 2665335
7198350 9999870 2879340
2879340 2879340 5758680
5758680 622560 7003800
6270264 63...

output:

0
1
0
1
0
0
0
1
1
1
1
1
0
1
1
0
0
0
1
0

result:

ok 20 lines

Test #73:

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

input:

20
7437360 6580168 3115392
1607256 9847936 8606360
8854552 8622208 7154504
5826688 8963976 3848320
10000000 5000000 5000000
2000000 200000 1800000
6800000 2000000 3200000
800000 6800000 10000000
9203026 9955975 4465001
3026174 5462534 8123728
6745415 9895935 9795447
1784057 7650439 7552637
8155030 2...

output:

0
1
0
0
1
0
1
1
0
0
0
0
1
0
0
0
0
1
0
0

result:

ok 20 lines

Test #74:

score: 0
Accepted
time: 3ms
memory: 3852kb

input:

20
1761945 2113480 793730
5134720 6236040 8450010
2505500 2490985 1468640
1649970 5931195 6511935
5553828 7180056 6599652
9398472 8350116 7954152
5020836 3779892 3926292
981072 6736236 6384000
1854736 7904800 9751824
7904800 9998608 9751824
2101520 7904800 1854736
7904800 2101520 9998608
9999936 401...

output:

0
0
1
1
0
0
0
0
1
1
1
1
1
1
0
1
0
0
0
0

result:

ok 20 lines

Test #75:

score: 0
Accepted
time: 3ms
memory: 3620kb

input:

20
2900000 1700000 200000
5000000 5000000 10000000
3200000 1700000 900000
5000000 4900000 2900000
6247376 3287080 5554588
3943164 3761568 5765192
2440520 9944564 8101372
8817692 9469632 8440144
3257122 6514244 3257122
3257122 6514244 3257122
4688596 8630336 9999572
601634 1037300 269698
9585702 5739...

output:

1
0
0
1
0
0
1
0
0
1
1
1
0
1
0
0
0
0
0
0

result:

ok 20 lines

Test #76:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

20
7288816 9999900 6622156
9111020 9111020 7288816
755548 444440 1111100
1599984 9111020 9111020
3303984 7693860 4499934
9364518 9867378 549219
9844428 6692271 4215813
6310230 4372179 9988605
1750860 953246 5155310
5155310 3832438 9999356
5155310 5155310 4863500
1750860 7246615 2227483
1782226 71395...

output:

0
0
0
1
0
1
0
0
0
1
1
0
1
1
1
0
1
0
0
1

result:

ok 20 lines

Test #77:

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

input:

20
10000000 7120000 320000
10000000 10000000 8000000
8000000 10000000 2000000
7120000 2000000 5120000
6980344 8795682 8987356
5868632 9528960 4468562
2644362 9835826 8923964
5305384 6845300 7543774
9999944 5367617 3897037
9999944 6249965 5367617
9999944 6249965 4779385
3897037 4779385 9999944
800000...

output:

1
0
1
1
1
0
0
0
0
0
1
0
1
1
0
0
0
1
1
0

result:

ok 20 lines

Test #78:

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

input:

20
7351344 4594590 9999990
9999990 3135132 5891886
3135132 9999990 4594590
7351344 5891886 9999990
6351498 4262730 5749872
6811650 2630148 9053448
6440694 4370874 5812248
2302104 6767106 5013312
6137885 2206880 9999925
8965450 6137885 9999925
9999925 2206880 5034445
5034445 9999925 8965450
2319570 4...

output:

1
0
1
1
1
1
1
0
1
1
1
0
0
0
1
1
1
0
0
0

result:

ok 20 lines

Test #79:

score: 0
Accepted
time: 4ms
memory: 3668kb

input:

20
6621615 3378375 9999990
540540 3378375 3918915
6621615 540540 7162155
7162155 9999990 3918915
7390080 6004440 6004440
6004440 7390080 6004440
9607104 4549518 1039230
1200888 4272390 9999702
8134641 9999909 8808210
3367845 8808210 9999909
8808210 3367845 1502577
8134641 8808210 1502577
1272013 636...

output:

1
0
1
1
1
1
0
0
1
1
1
1
0
0
1
1
0
1
0
0

result:

ok 20 lines

Test #80:

score: 0
Accepted
time: 4ms
memory: 3644kb

input:

20
1850000 10000000 4850000
1850000 5000000 850000
10000000 5000000 5000000
5000000 850000 4850000
9999859 6685702 645615
5537942 5537942 1434700
5537942 6900907 243899
6097475 5537942 9999859
5246880 9999936 7469088
3024672 5246880 9999936
9999936 4999968 4999968
4999968 9999936 4999968
3124980 499...

output:

1
0
1
1
1
1
1
0
1
1
1
1
0
0
1
1
0
0
0
1

result:

ok 20 lines

Test #81:

score: 0
Accepted
time: 2ms
memory: 3744kb

input:

20
449436 7303335 8202207
7190976 2808975 9999951
9999951 4044924 7303335
8202207 1011231 7190976
6115656 7644570 7644570
4132200 7644570 537186
537186 8760264 5991690
9999924 7644570 9462738
4513860 138888 5624964
4999968 9999936 4999968
624996 3124980 4999968
3472200 4513860 3124980
4954482 301053...

output:

1
0
1
0
0
1
0
1
1
0
0
0
0
0
0
1
0
0
0
1

result:

ok 20 lines

Test #82:

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

input:

20
4999960 4999960 9999920
8622380 6632600 663260
51020 663260 918360
1632640 4999960 6632600
9110114 2987426 8554832
9788506 7125586 6523608
1706354 4692012 3202602
3125278 6832462 6457646
6540534 9999990 3459456
486486 6756750 6594588
5405400 9999990 6756750
6540534 54054 6594588
6347148 2857834 5...

output:

1
0
1
0
1
0
1
0
1
1
1
1
0
1
0
0
0
0
0
0

result:

ok 20 lines

Test #83:

score: 0
Accepted
time: 2ms
memory: 3732kb

input:

20
7222176 9999936 555552
9999936 5138856 3472200
4999968 2222208 7222176
5138856 4999968 138888
5392330 1349725 1346441
6738769 1346441 5392330
6742053 5392330 6738769
1349725 6742053 5392330
3901386 6611466 9840978
2461656 2585868 654936
5318532 5092692 6176724
9553032 9999066 1089678
8813517 2474...

output:

1
1
0
0
1
1
1
0
0
0
1
1
1
0
1
0
0
0
0
1

result:

ok 20 lines

Test #84:

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

input:

20
5836450 5836450 2334580
9999440 4101010 2737450
5836450 5836450 2334580
2189960 1869730 1911050
7692230 59171 6923007
769223 7692230 6923007
6923007 6923007 8520624
6923007 9999899 3076892
6621615 2162160 8783775
540540 7162155 8783775
7162155 1216215 9999990
6621615 3378375 9999990
5408120 12755...

output:

0
1
1
1
0
0
1
0
0
1
0
0
1
1
1
0
1
0
1
1

result:

ok 20 lines

Test #85:

score: 0
Accepted
time: 4ms
memory: 3708kb

input:

20
67567 8445875 9999916
4999958 9999916 4999958
4121587 8445875 4999958
4121587 67567 4999958
78125 5781250 6953125
3828125 5781250 1953125
10000000 703125 6953125
5000000 5000000 10000000
6043228 9875028 8577316
3522468 5276392 5976316
4370972 3845672 4314668
4499084 2513212 4321400
1632640 867340...

output:

1
1
0
0
1
1
0
1
1
1
0
1
0
0
1
1
1
1
0
1

result:

ok 20 lines

Test #86:

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

input:

20
10000000 781250 5781250
2031250 781250 5000000
10000000 5000000 5000000
2031250 5781250 5000000
3378375 7837830 7162155
6621615 540540 7162155
6621615 3378375 9999990
9999990 7837830 540540
9999912 4326885 3942273
4999956 6249945 1249989
6249945 7019169 192306
4999956 6249945 1249989
9999990 7162...

output:

1
1
0
1
0
1
0
1
1
0
0
1
1
1
1
1
0
0
0
1

result:

ok 20 lines

Test #87:

score: 0
Accepted
time: 3ms
memory: 3648kb

input:

20
1994115 9956739 7962630
9949827 1987203 7962630
1994115 7962630 1987203
7962630 9956739 9949827
9999936 3086400 4197504
4197504 308640 4999968
3086400 308640 4999968
9999936 4999968 4999968
7052110 8068580 8265270
7100210 3296020 9266270
8103160 9925240 3294720
4706000 8207030 7819370
5000000 500...

output:

1
1
0
1
1
1
0
0
1
0
1
1
1
1
0
0
0
0
1
1

result:

ok 20 lines

Test #88:

score: 0
Accepted
time: 4ms
memory: 3588kb

input:

20
6611088 2973192 7044312
7783776 7593648 6286200
814920 3312744 4045092
9494028 2618928 9245808
7400000 2960000 7400000
8000000 10000000 10000000
10000000 10000000 800000
6100000 4040000 7460000
5997380 1543880 1484500
5997380 6840576 5997380
4869160 7695648 9999592
1484500 1543880 5997380
759540 ...

output:

0
0
0
0
0
0
1
0
0
1
1
1
1
1
0
1
0
0
0
0

result:

ok 20 lines

Test #89:

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

input:

20
9999934 7641459 2358475
7641459 9150883 1509424
7641459 9150883 1509424
9999934 7641459 2358475
9418000 138500 9002500
8476200 8005300 8005300
8545450 124650 9999700
8005300 8005300 8476200
4980188 8906840 8994908
4063920 7788524 6323184
7735552 9971692 8462400
6048156 2057544 6208384
9769092 996...

output:

1
0
0
0
1
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0

result:

ok 20 lines

Test #90:

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

input:

20
9286272 9673152 5062248
3180888 7864920 4947744
4318920 5436840 1477296
8374992 2974128 7936104
6292000 6292000 77440
6292000 6582400 484000
6582400 3581600 6292000
6669520 9999440 4975520
4999968 4999968 9999936
9999936 555552 7222176
4999968 5246880 246912
5246880 987648 7222176
3846115 6272126...

output:

0
0
1
1
0
0
0
0
1
0
0
0
1
0
1
0
0
0
1
0

result:

ok 20 lines

Test #91:

score: 0
Accepted
time: 3ms
memory: 3888kb

input:

20
3903310 6782795 5654580
6334940 6119590 3242660
6253545 9376850 9996985
2671800 7278830 5537050
9864855 2162160 8783775
3378375 9999990 9864855
3378375 9864855 2162160
8783775 9864855 9999990
9999978 8529393 7352925
3823521 2647053 1176468
8529393 3823521 1176468
7352925 2647053 9999978
2777760 4...

output:

0
1
1
1
0
0
1
0
0
0
0
1
0
0
0
1
0
0
0
0

result:

ok 20 lines

Test #92:

score: 0
Accepted
time: 4ms
memory: 3628kb

input:

20
5029535 5798758 9999899
5798758 5029535 59171
532539 3846115 5798758
3846115 5798758 7159691
7902360 8243820 9999900
7219440 48780 6097500
48780 7219440 6097500
9756000 7219440 7219440
5905199 5641036 5442819
1615298 7795272 7172575
7041820 7537931 3022904
9989682 9114571 4742427
9968976 7533936 ...

output:

1
0
0
0
0
1
1
0
1
1
1
0
1
1
1
1
1
0
1
0

result:

ok 20 lines

Test #93:

score: 0
Accepted
time: 3ms
memory: 3608kb

input:

20
9999920 2704060 2704060
1275500 2704060 4999960
2704060 4999960 1275500
4999960 9999920 4999960
7559951 781235 8557528
5865272 9999808 8557528
7559951 2932636 6261899
1730736 8557528 8557528
4999960 7550960 2551000
255100 408160 459180
9999920 4999960 4999960
7550960 6173420 255100
7591955 406120...

output:

1
0
1
0
0
1
1
0
1
0
0
1
1
0
0
1
1
0
0
0

result:

ok 20 lines

Test #94:

score: 0
Accepted
time: 4ms
memory: 3668kb

input:

20
6185963 1082563 7113353
5120196 3294334 7295221
9687967 6972069 7982356
5343807 2112534 4389874
9124000 9488960 2116768
9124000 2116768 2627712
9488960 9124000 9999904
9124000 2627712 9999904
7692300 9999990 769230
7692300 6153840 1538460
769230 7692300 6923070
3846150 6923070 6153840
2312500 181...

output:

0
1
0
0
0
0
0
1
1
1
1
0
1
0
0
1
1
0
1
0

result:

ok 20 lines

Test #95:

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

input:

20
6411474 2659548 8768976
2215434 2383896 3787992
3755136 2394942 4004820
5314968 5234856 5823576
9999977 1155232 9711169
9566765 9566765 7653412
4079413 4223817 72202
9566765 7653412 9566765
5000000 2500000 2500000
5000000 3125000 625000
10000000 8125000 3125000
625000 5000000 3125000
6021855 4900...

output:

0
0
0
0
1
1
0
1
0
1
0
1
1
0
0
1
0
1
0
1

result:

ok 20 lines

Test #96:

score: 0
Accepted
time: 3ms
memory: 3604kb

input:

20
5200000 1600000 3600000
10000000 3200000 5200000
2000000 4000000 2000000
2000000 4000000 2000000
8389000 3355600 8389000
8389000 5503184 9999688
4647506 9127232 755010
3355600 8389000 8389000
2057180 8082990 9302290
6208720 6540500 9226660
5833160 6104320 6787780
2958720 8470660 8697600
9577022 9...

output:

0
0
0
0
1
1
1
1
1
0
1
0
1
0
1
1
1
0
1
1

result:

ok 20 lines

Test #97:

score: 0
Accepted
time: 4ms
memory: 3728kb

input:

20
8362409 6995634 8358752
2790383 3575764 4650163
7570427 9606548 7539975
3384312 8382005 9805751
1019104 5413990 9999958
7706974 9999958 9299324
3121006 5413990 2292984
1592350 9299324 7706974
9999910 3588203 9941087
8529335 2176451 9999910
9941087 9999910 8529335
2176451 3588203 9999910
8630354 6...

output:

0
1
1
1
0
1
1
1
0
0
1
0
1
0
1
1
1
1
0
1

result:

ok 20 lines

Test #98:

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

input:

20
718224 7955712 4696080
7955712 718224 6022032
9999888 7955712 6022032
7955712 9999888 4696080
9999888 9557904 7182240
1602192 4419840 9557904
1602192 7182240 9557904
9999888 9557904 4419840
1953125 5703125 10000000
3906250 7656250 5000000
156250 3906250 5000000
5703125 703125 5000000
6400000 7300...

output:

1
1
1
1
0
1
1
0
0
1
1
1
1
0
1
1
1
1
0
1

result:

ok 20 lines

Test #99:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

20
5184252 8269072 5360423
8645537 395471 9004458
6063645 8255183 6602392
3900616 9141886 9995694
9319140 9813900 810720
6476370 5183520 5751090
5708040 8872140 9487260
7503060 3756510 5380830
4639761 9416183 9475032
3605175 6877493 3516387
5429004 4972471 9801617
3770501 4471936 8242143
7595198 934...

output:

0
0
0
0
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1

result:

ok 20 lines

Test #100:

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

input:

20
68965 4482725 4413760
9999925 5655130 5586165
5655130 68965 4482725
5586165 4413760 9999925
9999684 7696386 8145810
3511125 9999684 3398769
7696386 8145810 9999684
4747041 1460628 3286413
7937600 7937600 3794560
329120 3736480 6195200
3649360 9999440 7763360
3794560 7937600 7937600
2344776 999978...

output:

1
0
0
0
1
0
1
1
0
1
0
0
1
0
0
0
1
1
0
1

result:

ok 20 lines

Test #101:

score: 0
Accepted
time: 2ms
memory: 3880kb

input:

20
4426856 6024844 8415064
7687316 2111704 6943104
5237512 8392720 9816660
9984436 8042860 6660276
9872400 1927056 7947168
2047440 7947168 9992784
2047440 7947168 1927056
9992784 7947168 9872400
7538310 7538310 3015324
7628512 2641630 1610750
2641630 2641630 5283260
6558974 9999536 7538310
6358573 6...

output:

0
1
0
0
0
0
0
0
0
1
1
1
1
0
1
0
0
1
1
0

result:

ok 20 lines

Test #102:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

20
4482725 9999925 8827520
4482725 9999925 2344810
2344810 6689605 9999925
8827520 9999925 6689605
6037408 3018704 3018704
6400233 4760264 188669
6037408 3018704 3018704
4252309 7024292 9999457
1597400 1182076 3610124
1597400 7987000 6389600
1597400 7987000 6389600
3482332 9999724 7475832
3713560 32...

output:

1
0
0
0
0
1
0
1
1
1
0
1
0
1
1
1
1
0
0
1

result:

ok 20 lines

Test #103:

score: 0
Accepted
time: 4ms
memory: 3584kb

input:

20
4999944 3232008 6243024
6243024 110496 6243024
9999888 5110440 3121512
6243024 3232008 4999944
1250000 5000000 6250000
1250000 2500000 1250000
6250000 1250000 2500000
10000000 5000000 5000000
6953125 10000000 703125
10000000 5000000 5000000
5078125 78125 5000000
5078125 6953125 1250000
8200000 10...

output:

0
1
1
1
0
0
0
1
0
0
0
1
0
0
1
0
1
1
0
0

result:

ok 20 lines

Test #104:

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

input:

20
8278896 2429820 9929724
3885636 7383012 4429716
3647496 5073744 3363180
9457116 6727344 7343964
5451136 7781376 2468800
6022208 7154240 9962624
7385664 781120 7665344
4461184 3718912 7692416
3076920 6923070 9999990
769230 6230763 5615379
7692300 6923070 9999990
6923070 76923 5615379
9207370 99603...

output:

0
0
1
0
0
0
0
0
1
1
0
0
0
0
1
0
0
0
0
0

result:

ok 20 lines

Test #105:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

20
974062 1008583 1148221
9877187 6518475 4227657
8954999 8908971 1405519
1872533 3757979 3127203
4999955 9999910 4999955
117646 8470512 9999910
3588203 8470512 4999955
3588203 4999955 117646
5000000 2600000 1600000
4050000 2600000 3050000
50000 3600000 3050000
5000000 10000000 5000000
10000000 6480...

output:

0
1
1
1
0
1
0
1
1
0
1
0
0
0
1
1
0
1
1
1

result:

ok 20 lines

Test #106:

score: 0
Accepted
time: 4ms
memory: 3756kb

input:

20
5200000 10000000 7200000
3600000 3600000 7200000
7200000 3600000 3600000
7200000 5200000 400000
9999951 7190976 8202207
1011231 7640412 9999951
7190976 1011231 8202207
449436 7640412 7190976
3062500 2125000 9562500
3062500 9562500 10000000
2125000 9062500 9562500
9062500 9562500 10000000
4524900 ...

output:

1
1
1
0
1
1
1
0
1
0
0
1
0
0
0
1
1
1
1
1

result:

ok 20 lines

Test #107:

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

input:

20
902772 3402756 6249960
1736100 902772 1249992
4999968 6249960 1249992
4999968 9999936 4999968
9999595 6112112 1370731
6112112 382007 6494119
9550175 382007 9932182
4426787 9932182 9550175
9999990 3769227 6230763
1923075 6230763 8153838
9999990 1538460 8153838
1538460 307692 1230768
2000000 160000...

output:

1
0
1
1
0
0
1
0
0
0
1
1
0
1
0
0
1
1
1
1

result:

ok 20 lines

Test #108:

score: 0
Accepted
time: 7ms
memory: 3712kb

input:

20
1555010 7785026 6230020
1555010 1560002 6230020
7790018 6230020 7785026
1560002 7790018 6230020
943360 943360 1886720
9999616 4999808 4999808
849024 8608160 5495072
8608160 9999616 589600
6741606 1682223 1688583
6741606 8430183 1688583
8430183 8423823 6741606
6741606 1682223 8423823
9999990 76923...

output:

1
0
1
1
1
0
0
1
1
1
0
1
1
1
0
0
0
1
0
0

result:

ok 20 lines

Test #109:

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

input:

20
8536220 5780610 4341150
8878760 4013900 8972370
9217230 9962480 9612350
5680070 1830510 5665110
9827607 9117107 7220681
7698978 2025621 9643196
6376027 5050843 8570979
1828856 7505635 8085780
3599964 6777710 6777710
7877699 4311068 6055495
6777710 9999900 911102
1799982 1799982 3599964
5703125 10...

output:

0
0
0
1
1
1
0
0
1
1
0
0
0
0
1
1
1
1
0
0

result:

ok 20 lines

Test #110:

score: 0
Accepted
time: 2ms
memory: 3928kb

input:

20
703125 1953125 2656250
5000000 10000000 5000000
10000000 5703125 1953125
2656250 703125 5703125
816320 4999960 2959160
2959160 4999960 5102000
1632640 9999920 5918320
5918320 918360 4999960
7346880 3775480 4999960
918360 1020400 3775480
9999920 4999960 4999960
204080 1020400 1632640
6111775 58351...

output:

1
1
1
0
0
1
1
1
0
1
1
1
0
0
1
1
0
0
1
0

result:

ok 20 lines

Test #111:

score: 0
Accepted
time: 6ms
memory: 3720kb

input:

20
3756864 497232 6906000
6740256 6906000 497232
9999888 6906000 6740256
9999888 3756864 6906000
4062500 62500 5000000
10000000 62500 8562500
5000000 5000000 10000000
8562500 4062500 5000000
6895200 6396000 5553600
6895200 9516000 2246400
9999600 9516000 2698800
9516000 4758000 4758000
6923070 30769...

output:

1
1
0
1
0
1
1
1
1
0
1
1
0
0
1
0
1
0
0
1

result:

ok 20 lines

Test #112:

score: 0
Accepted
time: 4ms
memory: 3628kb

input:

20
7514504 2718042 6794004
6366904 5613172 5919144
2006020 1711556 482310
2834418 7211958 6005312
4651629 9303258 4651629
4651629 4651629 9303258
9303258 9999345 1602105
3590925 8861298 9689973
7027020 8270262 9135126
1351350 270270 2810808
9999990 9135126 864864
2810808 7027020 7027020
88495 566368...

output:

0
0
0
1
1
0
1
0
1
1
1
1
0
1
1
1
1
0
1
1

result:

ok 20 lines

Test #113:

score: 0
Accepted
time: 4ms
memory: 3876kb

input:

20
9999916 2499979 3040515
4999958 3040515 1148639
9999916 4999958 4999958
2499979 4999958 1148639
7723896 3078128 7833024
2839424 2830864 1853744
9298384 4960336 7826536
7269568 7651792 4214504
3103290 5945000 2627690
475600 5945000 5945000
5754760 9999490 4767890
963090 4767890 5945000
9999780 201...

output:

1
0
0
0
0
0
1
1
0
1
1
1
0
1
0
1
0
0
1
1

result:

ok 20 lines

Test #114:

score: 0
Accepted
time: 4ms
memory: 3636kb

input:

20
3625000 5000000 2125000
2125000 1625000 5000000
5000000 5000000 10000000
10000000 3625000 1625000
4196853 1295325 5492178
7461072 466317 7927389
7461072 9999909 2538837
7927389 9999909 5492178
1923075 769230 4999995
4999995 4999995 769230
1923075 9999990 4999995
4999995 9999990 4999995
9999878 45...

output:

1
1
1
0
0
1
1
0
0
1
0
0
1
0
0
1
0
1
0
0

result:

ok 20 lines

Test #115:

score: 0
Accepted
time: 3ms
memory: 3952kb

input:

20
9999990 5555550 888888
555555 4999995 5555550
9999990 4999995 4999995
2222220 1999998 5555550
3450160 2941120 2590448
328048 7612976 9999808
5882240 5791744 5882240
2941120 2941120 5882240
6953125 3828125 2031250
10000000 703125 6953125
78125 1953125 2031250
5000000 5000000 10000000
6503847 53562...

output:

1
0
1
0
0
1
1
0
1
1
1
1
0
0
1
1
0
0
0
0

result:

ok 20 lines

Test #116:

score: 0
Accepted
time: 4ms
memory: 3752kb

input:

20
9685413 8902980 4228713
9391518 6792147 3980475
1314522 2202687 3201336
2224557 1681722 1159191
2332204 5191550 1038310
5063758 9999724 6725054
5191550 6725054 415324
5191550 5191550 798700
9999910 9941087 3117619
2352920 9941087 3117619
9999910 9235211 9941087
9235211 9941087 2352920
5000000 390...

output:

0
0
1
1
0
1
1
1
0
0
0
0
1
1
0
0
1
1
0
1

result:

ok 20 lines

Test #117:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

20
6420482 1915156 9999626
1334330 9811250 4803588
2574472 5148944 2574472
2574472 5148944 2574472
5754618 9999828 849042
6462153 1745253 4905576
4905576 6131970 6131970
3065985 3065985 6131970
5555520 1736100 8402724
69444 1736100 2222208
5555520 4999968 555552
4999968 4999968 9999936
4999968 25694...

output:

0
0
1
1
1
0
1
1
1
1
1
0
1
1
1
0
0
0
0
0

result:

ok 20 lines

Test #118:

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

input:

20
7609325 3102125 9834900
4908650 4377825 2133925
5315025 8605525 5530975
5877175 7655975 8079075
7744010 9684405 9675605
1940405 7744010 1931605
1940405 7744010 9684405
7744010 9675605 1931605
5405400 9189180 540540
6756750 6756750 5405400
4324320 5405400 5405400
4594590 9999990 1081080
5918320 86...

output:

0
1
0
1
0
1
1
1
1
1
0
0
0
1
0
1
0
1
0
0

result:

ok 20 lines

Test #119:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

20
3209856 1388880 8672784
6820944 6820944 3086400
7222176 6820944 6820944
9999936 1265424 6820944
5882340 9999978 588234
588234 2647053 4999989
2647053 5882340 4999989
9999978 4999989 4999989
6017458 7146809 9321669
2514409 5375508 7529241
9868381 7271166 5723160
6258624 3940056 9805185
505611 9999...

output:

0
1
0
1
1
0
1
1
1
1
1
1
1
0
0
0
0
0
0
0

result:

ok 20 lines

Test #120:

score: 0
Accepted
time: 4ms
memory: 3704kb

input:

20
5950368 5041284 9999924
3057828 5950368 2066100
5950368 3057828 4049556
5041284 82644 5950368
1295325 2590650 1295325
2538837 7461072 9999909
7461072 8756397 9999909
2590650 2538837 8756397
9999920 9510128 2938752
7346880 5550976 163264
5877504 5550976 5550976
5550976 9999920 693872
5752659 20579...

output:

1
1
0
0
1
1
1
1
1
0
1
1
1
0
1
0
1
1
0
1

result:

ok 20 lines

Test #121:

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

input:

20
7315426 6711400 604026
6711400 7315426 604026
9999986 6711400 7315426
9999986 7315426 1073824
7641459 849051 8490510
8490510 9999934 377356
9150883 7641459 9999934
9150883 7641459 1509424
5623970 5623970 8778880
5623970 3854477 3525269
1673474 9999693 3525269
5623970 1975248 2002682
8000000 62500...

output:

1
1
0
1
1
1
0
0
1
0
0
0
1
1
0
1
1
0
0
0

result:

ok 20 lines

Test #122:

score: 0
Accepted
time: 6ms
memory: 3756kb

input:

20
4999968 2098752 1543200
9999936 4999968 4999968
4999968 3765408 2098752
3765408 1543200 9999936
3950592 9999936 5061696
4999968 9999936 4999968
9999936 6172800 5061696
4999968 4999968 9999936
7688812 9822124 2222200
3199968 9999900 5199948
7511036 5199948 2311088
2311088 5199948 7511036
5954040 7...

output:

1
1
0
0
1
0
0
1
0
0
0
0
1
0
1
0
1
1
1
1

result:

ok 20 lines

Test #123:

score: 0
Accepted
time: 4ms
memory: 3652kb

input:

20
2900000 4900000 800000
5000000 5000000 10000000
2900000 900000 5000000
1800000 2900000 2900000
8200000 1800000 5200000
10000000 5000000 5000000
200000 5200000 5000000
200000 8200000 10000000
9999983 3448270 4482751
5862059 1379308 5862059
4482751 6896540 5862059
689654 689654 1379308
4419571 4419...

output:

1
1
0
0
0
0
0
0
0
1
0
1
1
0
0
1
1
0
0
1

result:

ok 20 lines

Test #124:

score: 0
Accepted
time: 3ms
memory: 3720kb

input:

20
1600000 5200000 3600000
1600000 5200000 2000000
4000000 5200000 3600000
10000000 5800000 1800000
4977827 4992598 369275
5908400 7385500 7385500
7385500 7385500 5908400
6277675 9999967 768092
8773490 3684978 5419260
9468470 5453426 8211170
9646890 2491412 9389578
3260818 3899412 5061870
8109486 91...

output:

0
0
0
0
0
0
1
0
0
1
1
0
0
1
0
0
1
0
0
0

result:

ok 20 lines

Test #125:

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

input:

20
9999936 4999968 4999968
617280 2283936 4999968
9999936 2283936 4506144
617280 4999968 4506144
7465737 6095877 9999978
7465737 8561625 273972
68493 7123272 7465737
7465737 7739709 7123272
6922944 9855580 9855580
4711448 9855580 9855580
3461472 9855580 9278668
961520 9999808 4807600
8305782 3504246...

output:

1
0
0
0
1
1
0
0
0
1
1
1
1
0
1
0
0
0
0
1

result:

ok 20 lines

Test #126:

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

input:

20
2107575 7064580 7974775
6668715 6271330 8245335
4315185 5056565 7004065
7476215 9940230 6020340
2655648 5439024 5608936
9228608 3790408 7722152
4355272 2044760 3759256
3489048 3470640 2372784
9531250 2656250 6250000
9531250 9765625 1328125
6250000 9531250 2656250
7031250 9531250 10000000
5799080 ...

output:

0
0
0
0
1
1
0
0
1
0
0
0
0
1
1
1
0
1
0
1

result:

ok 20 lines

Test #127:

score: 0
Accepted
time: 4ms
memory: 3652kb

input:

20
6677940 705721 6964305
7103093 8528407 5998280
9572564 8736504 5549293
6022352 3082542 4962368
5598635 5983320 5839043
8631399 2440592 7337127
8348984 8903531 5773894
5427170 7537971 9518194
9135126 9999990 864864
8270262 9135126 7027020
2810808 7027020 7027020
1351350 2810808 270270
7641459 9999...

output:

0
0
0
1
1
0
1
0
1
1
0
0
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #128:

score: 0
Accepted
time: 3ms
memory: 3876kb

input:

20
4668456 1174020 1174020
3991668 4999944 4378404
9999888 4999944 4999944
1616004 3825924 9999888
8000000 1000000 5000000
10000000 5000000 5000000
10000000 2000000 4000000
1000000 8000000 5000000
2769228 6923070 1384614
7692300 6923070 9999990
769230 1384614 1230768
6923070 3076920 9999990
1413762 ...

output:

0
0
1
0
1
1
1
1
0
1
1
0
0
0
0
1
1
0
1
0

result:

ok 20 lines

Test #129:

score: 0
Accepted
time: 4ms
memory: 3600kb

input:

20
4050000 5050000 10000000
4050000 10000000 5050000
5050000 50000 5000000
5050000 5000000 50000
6411768 8750704 4804968
1560144 4334960 5254112
2592672 6963376 9276376
8933528 7061296 4059920
1911754 2499986 2941160
7647016 9558770 9558770
7647016 9558770 9558770
1176464 5294088 9999944
2414189 242...

output:

1
0
0
0
0
0
0
0
1
1
1
0
0
0
1
0
1
0
0
0

result:

ok 20 lines

Test #130:

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

input:

20
3383530 4259140 97290
4432100 8864200 4432100
8864200 8864200 7091360
9999250 7837250 4432100
4295296 6778514 9999986
6711400 268456 6979856
6711400 67114 6778514
6979856 9999986 5436234
1250000 5703125 8828125
10000000 5000000 5000000
5000000 5703125 703125
10000000 78125 8828125
9445446 6004440...

output:

0
1
1
0
0
0
0
0
0
1
0
0
1
0
0
1
0
1
0
0

result:

ok 20 lines

Test #131:

score: 0
Accepted
time: 3ms
memory: 3644kb

input:

20
9150883 7641459 1509424
9150883 3396204 8018815
8018815 849051 9999934
9999934 2358475 7641459
548775 4999950 2256075
5182875 4999950 548775
9999900 5182875 2256075
4999950 4999950 9999900
7194147 9284226 7656240
4096668 5408358 7576269
8551584 9912540 9298854
6681477 4150350 2769384
2777760 1111...

output:

1
1
0
1
0
1
0
0
1
1
0
1
0
0
0
1
1
0
0
1

result:

ok 20 lines

Test #132:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

20
7176406 9999910 2117628
8058751 7117583 9999910
7117583 941168 8058751
7117583 58823 7176406
8745492 8338044 7357452
5761176 4943376 2209956
4597080 5200644 9289224
7668036 4209444 6738372
9999330 5481498 704616
3523080 3523080 7046160
673530 5274258 7046160
5274258 5274258 5989236
9999990 610810...

output:

1
0
0
0
0
1
0
1
1
0
0
0
0
1
0
1
0
1
1
1

result:

ok 20 lines

Test #133:

score: 0
Accepted
time: 2ms
memory: 3676kb

input:

20
500000 4500000 5000000
500000 5000000 2500000
10000000 4500000 2500000
10000000 5000000 5000000
2515609 7935328 7596943
9674122 9219066 6357643
8449272 5221040 8490259
9460313 7688250 8377209
6499935 499995 9999900
2722195 6499935 2222200
555550 4999950 5555500
4999950 4999950 9999900
5000000 500...

output:

1
0
1
1
0
1
0
0
1
1
0
1
0
1
1
0
1
0
1
0

result:

ok 20 lines

Test #134:

score: 0
Accepted
time: 4ms
memory: 3644kb

input:

20
6062500 10000000 562500
1250000 3062500 6062500
1250000 6250000 5000000
10000000 5000000 5000000
6594588 9999990 5891886
6594588 54054 6540534
6540534 9999990 3459456
5405400 486486 5891886
6883266 9998940 4200772
7404514 2280818 5886236
6473714 3997070 2533208
8969690 9879010 9082460
3020130 604...

output:

1
1
0
1
1
0
0
1
1
0
1
1
0
1
1
1
1
1
1
0

result:

ok 20 lines

Test #135:

score: 0
Accepted
time: 7ms
memory: 3644kb

input:

20
8558892 8258142 1141800
7313208 9291624 6108636
5935116 5639610 6354534
3756600 3091530 4709004
1423250 1428026 5702548
1423250 7125794 5702548
7125794 5702548 7130570
5702548 7130570 1428026
1600000 2000000 5200000
10000000 5000000 5000000
3600000 3200000 2000000
5200000 200000 5000000
661152 61...

output:

0
1
1
0
1
0
1
1
0
1
0
0
0
0
1
0
0
0
0
0

result:

ok 20 lines

Test #136:

score: 0
Accepted
time: 2ms
memory: 3888kb

input:

20
4644500 5184004 3016356
1591310 6432636 5249209
7012152 9309825 5171033
9227197 8149680 9640575
3298944 9999924 2577300
7525716 9175188 3505128
3711312 2577300 6288612
7525716 7525716 3711312
7788393 6923016 4326885
480765 7788393 9999912
6923016 7692240 769224
6923016 9999912 3076896
246912 9999...

output:

0
0
1
1
0
0
1
1
0
1
0
1
1
0
0
0
1
1
1
1

result:

ok 20 lines

Test #137:

score: 0
Accepted
time: 3ms
memory: 3752kb

input:

20
8276835 8276835 6621468
9999768 3276951 3412083
1351320 3580998 9256542
8276835 8276835 6621468
1677850 6979856 7315426
604026 7315426 6711400
3288586 9999986 6711400
1677850 6979856 9999986
9761570 3780440 6474640
7019170 9504020 9999630
6873290 8802940 7929420
5054010 6346130 5400080
9999910 48...

output:

0
1
0
1
1
0
0
1
0
0
0
1
1
0
1
0
1
0
1
1

result:

ok 20 lines

Test #138:

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

input:

20
5199961 799994 5199961
7199946 1230760 3261514
9846080 2615365 9999925
799994 5199961 5199961
7555548 8222214 9999990
9999990 1999998 7999992
222222 7999992 8222214
7555548 1999998 5555550
5046444 4650624 5774670
9985878 1085112 9280980
4971636 5484726 5338152
5106960 3022614 8039448
2840513 1362...

output:

0
1
0
0
1
1
0
1
1
1
0
0
1
0
0
0
1
0
0
1

result:

ok 20 lines

Test #139:

score: 0
Accepted
time: 3ms
memory: 3948kb

input:

20
55248 110496 55248
9999888 4475088 5524800
9999888 110496 9999888
5524800 4475088 9999888
8256870 7798155 1192659
7798155 9999987 8256870
1192659 2935776 7798155
2935776 9999987 7798155
9645354 9506424 2611992
8745210 2665356 6370350
3476046 8456472 8087478
6045186 3683334 4434888
5000000 7812500...

output:

1
1
0
1
0
0
0
1
1
1
1
0
1
1
1
1
1
1
1
0

result:

ok 20 lines

Test #140:

score: 0
Accepted
time: 3ms
memory: 3748kb

input:

20
2737504 5090400 7827904
3993136 463792 3823456
2737504 7827904 5090400
6696704 7827904 9999808
8684039 6588897 7309449
9787344 4850272 9093987
2320871 6704663 4899769
6208237 3156587 3515645
8237369 6344611 3921099
7582197 3374665 8959531
1812426 1791090 1829023
7377461 6461210 4454345
9999888 38...

output:

0
0
0
0
0
1
1
0
1
0
1
0
0
0
1
1
1
0
1
1

result:

ok 20 lines

Test #141:

score: 0
Accepted
time: 4ms
memory: 3664kb

input:

20
3675672 9999990 2432430
7891884 9135126 9999990
9135126 9999990 3675672
7891884 2432430 9999990
8020630 4082793 5828341
7195503 6325116 1842888
9898641 7747644 5637846
9181301 4121574 9815716
5530460 1960445 7110420
9474250 5637670 9411975
8883850 5344105 8892945
4325875 6886465 5059890
6235185 5...

output:

1
0
0
0
0
0
1
0
0
1
0
0
1
1
0
1
0
0
1
0

result:

ok 20 lines

Test #142:

score: 0
Accepted
time: 2ms
memory: 3884kb

input:

20
1093721 4380802 1096681
4380802 1093721 5474521
4380802 5477481 5474521
5477481 4380802 1096681
5955849 735290 8014661
5955849 8014661 9999944
4779385 8014661 735290
9999944 8014661 4779385
4364060 3596136 4604452
1899160 6825540 5734504
6242952 8252944 6311692
5738596 7091988 4573368
8280220 796...

output:

1
1
0
1
1
0
1
0
1
0
1
1
0
1
1
0
1
1
0
0

result:

ok 20 lines

Test #143:

score: 0
Accepted
time: 3ms
memory: 3628kb

input:

20
5000000 10000000 5000000
5000000 800000 5800000
2500000 1800000 1300000
2500000 1300000 5800000
6089576 4123456 5049744
3811552 5422980 3925324
9878632 5655312 8121892
1674204 1667744 487008
9477904 7377648 2461128
5628760 7923000 9059312
4208072 6139080 2626416
8511496 7566184 4361120
5000000 50...

output:

1
0
0
1
1
1
0
0
0
1
0
1
1
0
0
1
0
1
1
1

result:

ok 20 lines

Test #144:

score: 0
Accepted
time: 3ms
memory: 3872kb

input:

20
9999990 3076920 6923070
1384614 2769228 6923070
1384614 769230 1230768
7692300 6923070 9999990
2680180 5360360 2680180
3789220 4898260 8909288
2680180 2680180 5360360
3419540 1922336 9999844
3343251 1356890 4563794
2019449 6772700 4977723
8403036 9997746 5281014
4524032 2880019 3581682
3684882 16...

output:

1
0
0
0
0
1
0
1
1
0
1
1
1
0
0
0
1
0
0
0

result:

ok 20 lines

Test #145:

score: 0
Accepted
time: 4ms
memory: 3876kb

input:

20
896545 7310290 3103425
7310290 7793045 896545
7310290 7793045 9999925
9999925 3103425 7310290
9922203 1987203 7935006
9915303 7935006 9922203
7935006 1987203 1980303
9915303 1980303 7935006
1219510 9024374 4878040
4878040 9999982 9024374
1219510 6341452 9024374
9024374 9999982 6341452
3257856 999...

output:

1
1
1
0
0
1
1
1
0
0
0
0
1
0
1
1
1
1
1
1

result:

ok 20 lines

Test #146:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

20
9999924 2113386 3350490
1907202 953601 953601
5283465 7860765 5206146
5283465 5283465 2113386
1620530 1615442 6471940
8092466 6471940 1620530
6471940 8087378 8092466
8087378 1615442 6471940
2987775 9999900 6158475
9999900 6158475 7621875
4451175 9999900 7621875
9999900 2987775 4451175
5312500 812...

output:

0
1
1
1
1
0
1
1
0
0
1
1
1
1
0
0
1
0
0
0

result:

ok 20 lines

Test #147:

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

input:

20
9579810 4663130 9915180
3731570 4630260 2089390
6654610 5039560 9168010
8132500 2065230 7994760
6837015 9388410 6840270
6910320 1668120 6672810
3745110 9619650 8121735
9510120 8510550 6385320
9019374 6753684 5632697
3391542 2390717 2184546
3136119 7105420 6310101
6939072 3157539 7644826
6563550 9...

output:

0
0
0
0
1
1
1
0
0
1
0
1
0
1
0
1
1
1
0
1

result:

ok 20 lines

Test #148:

score: 0
Accepted
time: 3ms
memory: 3684kb

input:

20
8384607 7769223 9999990
7769223 1230768 8384607
3461535 1230768 8384607
3461535 8384607 9999990
1543200 3950592 5493792
5493792 8950560 987648
8950560 61728 9999936
4999968 4999968 9999936
961535 9999964 4807675
4999982 4999982 9999964
961535 2499991 4999982
4807675 2499991 4999982
9444384 472219...

output:

1
1
1
0
1
0
1
1
1
1
1
1
1
1
0
0
1
0
1
1

result:

ok 20 lines

Test #149:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

2
50176 129600 179776
11025 129600 140625
18496 65025 83521
179776 140625 83521
68121 1557504 1625625
132496 1557504 1690000
974169 781456 1755625
6765201 3125824 9891025

output:

1
0

result:

ok 2 lines

Test #150:

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

input:

20
1 1 2
1 1 2
1 1 2
1 1 2
2 2 4
1 1 2
1 1 2
1 1 2
1 4 5
1 4 5
1 4 5
1 4 5
1 4 5
1 4 5
1 4 5
2 2 4
1 4 5
1 4 5
2 2 4
2 2 4
1 4 5
2 2 4
2 2 4
2 2 4
2 5 5
2 5 5
2 5 5
1 4 5
2 5 5
2 5 5
2 5 5
1 2 5
2 5 5
2 5 5
2 5 5
2 2 4
2 5 5
2 5 5
2 5 5
1 1 2
2 5 5
2 5 5
1 4 5
1 4 5
2 5 5
2 5 5
1 4 5
2 2 4
2 5 5
2 5...

output:

1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0

result:

ok 20 lines

Test #151:

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

input:

20
2 5 5
1 2 5
2 2 4
2 2 4
2 5 5
2 2 4
2 2 4
2 2 4
2 5 5
2 2 4
2 2 4
1 1 2
4 5 5
4 5 5
1 4 5
1 2 5
4 5 5
4 5 5
1 4 5
1 1 2
4 5 5
4 5 5
1 2 5
1 2 5
4 5 5
4 5 5
1 2 5
2 2 4
4 5 5
4 5 5
1 2 5
1 1 2
4 5 5
4 5 5
2 2 4
1 1 2
4 5 5
4 5 5
1 1 2
1 1 2
4 5 5
2 5 5
2 5 5
1 2 5
4 5 5
2 5 5
2 5 5
1 1 2
4 5 5
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0

result:

ok 20 lines

Test #152:

score: 0
Accepted
time: 26ms
memory: 3692kb

input:

20
4 5 5
1 4 5
1 4 5
1 2 5
4 5 5
1 4 5
1 4 5
2 2 4
4 5 5
1 4 5
1 4 5
1 1 2
4 5 5
1 4 5
1 2 5
2 2 4
4 5 5
1 4 5
1 2 5
1 1 2
4 5 5
1 4 5
2 2 4
2 2 4
4 5 5
1 4 5
2 2 4
1 1 2
4 5 5
1 4 5
1 1 2
1 1 2
4 5 5
1 2 5
2 2 4
2 2 4
4 5 5
1 2 5
2 2 4
1 1 2
4 5 5
2 2 4
2 2 4
2 2 4
4 5 5
2 2 4
2 2 4
1 1 2
4 5 5
2 2...

output:

0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #153:

score: 0
Accepted
time: 6ms
memory: 3620kb

input:

20
3 3 6
3 3 6
2 5 5
2 5 5
3 3 6
3 3 6
2 5 5
1 4 5
3 3 6
3 3 6
2 5 5
1 2 5
3 3 6
3 3 6
2 5 5
2 2 4
3 3 6
3 3 6
2 5 5
1 1 2
3 3 6
3 3 6
1 4 5
1 4 5
3 3 6
4 5 5
2 5 5
1 2 5
3 3 6
4 5 5
2 5 5
1 1 2
3 3 6
4 5 5
1 4 5
1 4 5
3 3 6
4 5 5
1 4 5
1 2 5
3 3 6
4 5 5
1 4 5
2 2 4
3 3 6
4 5 5
1 4 5
1 1 2
3 3 6
4 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #154:

score: 0
Accepted
time: 7ms
memory: 3624kb

input:

20
3 3 6
2 5 5
1 4 5
2 2 4
3 3 6
2 5 5
2 2 4
2 2 4
3 3 6
1 4 5
1 4 5
1 4 5
3 3 6
1 4 5
1 4 5
1 2 5
3 3 6
1 4 5
1 4 5
2 2 4
3 3 6
1 4 5
1 4 5
1 1 2
3 3 6
1 4 5
1 2 5
1 2 5
3 3 6
1 4 5
1 2 5
2 2 4
3 3 6
1 4 5
1 2 5
1 1 2
3 3 6
1 4 5
2 2 4
2 2 4
3 3 6
1 4 5
2 2 4
1 1 2
3 3 6
1 4 5
1 1 2
1 1 2
3 3 6
1 2...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #155:

score: 0
Accepted
time: 13ms
memory: 3584kb

input:

20
3 3 6
1 1 2
1 1 2
1 1 2
4 4 8
4 4 8
4 4 8
4 5 5
4 4 8
4 4 8
4 5 5
4 5 5
4 4 8
4 4 8
1 4 5
1 2 5
4 4 8
4 4 8
1 2 5
1 2 5
4 4 8
3 3 6
3 3 6
3 3 6
4 4 8
3 3 6
3 3 6
2 5 5
4 4 8
3 3 6
3 3 6
1 4 5
4 4 8
3 3 6
3 3 6
2 2 4
4 4 8
3 3 6
2 5 5
1 2 5
4 4 8
3 3 6
2 5 5
1 1 2
4 4 8
3 3 6
1 4 5
1 4 5
4 4 8
3 3...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #156:

score: 0
Accepted
time: 25ms
memory: 3680kb

input:

20
4 4 8
4 5 5
1 2 5
1 1 2
4 4 8
4 5 5
2 2 4
1 1 2
4 4 8
4 5 5
1 1 2
1 1 2
4 4 8
2 5 5
2 5 5
1 2 5
4 4 8
2 5 5
2 5 5
1 1 2
4 4 8
2 5 5
1 4 5
1 4 5
4 4 8
2 5 5
1 4 5
1 2 5
4 4 8
2 5 5
1 4 5
2 2 4
4 4 8
2 5 5
1 4 5
1 1 2
4 4 8
2 5 5
1 2 5
2 2 4
4 4 8
2 5 5
1 2 5
1 1 2
4 4 8
2 5 5
2 2 4
2 2 4
4 4 8
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #157:

score: 0
Accepted
time: 32ms
memory: 3880kb

input:

20
4 4 8
1 4 5
1 2 5
1 1 2
4 4 8
1 4 5
2 2 4
1 1 2
4 4 8
1 4 5
1 1 2
1 1 2
4 4 8
1 2 5
1 2 5
2 2 4
4 4 8
1 2 5
2 2 4
2 2 4
4 4 8
1 2 5
2 2 4
1 1 2
4 4 8
2 2 4
2 2 4
1 1 2
4 4 8
2 2 4
1 1 2
1 1 2
1 5 8
1 5 8
1 5 8
4 4 8
1 5 8
1 5 8
1 5 8
4 5 5
1 5 8
1 5 8
4 4 8
3 3 6
1 5 8
1 5 8
4 4 8
2 5 5
1 5 8
1 5...

output:

1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #158:

score: 0
Accepted
time: 24ms
memory: 3740kb

input:

20
1 5 8
1 5 8
4 5 5
2 2 4
1 5 8
1 5 8
2 5 5
2 5 5
1 5 8
1 5 8
1 4 5
1 4 5
1 5 8
1 5 8
1 4 5
2 2 4
1 5 8
1 5 8
2 2 4
2 2 4
1 5 8
4 4 8
4 4 8
1 2 5
1 5 8
4 4 8
3 3 6
3 3 6
1 5 8
4 4 8
3 3 6
1 4 5
1 5 8
4 4 8
3 3 6
1 2 5
1 5 8
4 4 8
4 5 5
1 2 5
1 5 8
4 4 8
4 5 5
1 1 2
1 5 8
4 4 8
2 5 5
1 4 5
1 5 8
4 4...

output:

0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #159:

score: 0
Accepted
time: 15ms
memory: 3872kb

input:

20
1 5 8
4 4 8
1 2 5
1 1 2
1 5 8
4 4 8
2 2 4
1 1 2
1 5 8
4 4 8
1 1 2
1 1 2
1 5 8
3 3 6
3 3 6
4 5 5
1 5 8
3 3 6
3 3 6
2 5 5
1 5 8
3 3 6
3 3 6
1 4 5
1 5 8
3 3 6
4 5 5
1 4 5
1 5 8
3 3 6
4 5 5
1 2 5
1 5 8
3 3 6
4 5 5
2 2 4
1 5 8
3 3 6
4 5 5
1 1 2
1 5 8
3 3 6
2 5 5
2 5 5
1 5 8
3 3 6
2 5 5
1 4 5
1 5 8
3 3...

output:

1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #160:

score: 0
Accepted
time: 56ms
memory: 3876kb

input:

20
1 5 8
4 5 5
2 5 5
2 2 4
1 5 8
4 5 5
2 5 5
1 1 2
1 5 8
4 5 5
1 4 5
1 4 5
1 5 8
4 5 5
1 4 5
2 2 4
1 5 8
4 5 5
1 4 5
1 1 2
1 5 8
4 5 5
2 2 4
2 2 4
1 5 8
4 5 5
2 2 4
1 1 2
1 5 8
2 5 5
2 5 5
2 5 5
1 5 8
2 5 5
2 5 5
1 4 5
1 5 8
2 5 5
2 5 5
2 2 4
1 5 8
2 5 5
1 4 5
1 4 5
1 5 8
2 5 5
1 4 5
2 2 4
1 5 8
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0

result:

ok 20 lines

Test #161:

score: 0
Accepted
time: 41ms
memory: 3872kb

input:

20
2 5 9
2 5 9
2 5 9
2 2 4
2 5 9
2 5 9
2 5 9
1 1 2
2 5 9
2 5 9
1 5 8
1 5 8
2 5 9
2 5 9
1 5 8
3 3 6
2 5 9
2 5 9
1 5 8
2 5 5
2 5 9
2 5 9
1 5 8
1 4 5
2 5 9
2 5 9
1 5 8
2 2 4
2 5 9
2 5 9
4 4 8
1 2 5
2 5 9
2 5 9
4 4 8
1 1 2
2 5 9
2 5 9
3 3 6
3 3 6
2 5 9
2 5 9
3 3 6
1 4 5
2 5 9
2 5 9
3 3 6
1 2 5
2 5 9
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #162:

score: 0
Accepted
time: 30ms
memory: 3624kb

input:

20
2 5 9
2 5 9
1 4 5
1 4 5
2 5 9
2 5 9
1 4 5
2 2 4
2 5 9
2 5 9
2 2 4
2 2 4
2 5 9
1 5 8
1 5 8
4 4 8
2 5 9
1 5 8
1 5 8
3 3 6
2 5 9
1 5 8
1 5 8
4 5 5
2 5 9
1 5 8
1 5 8
2 5 5
2 5 9
1 5 8
4 4 8
1 4 5
2 5 9
1 5 8
4 4 8
1 2 5
2 5 9
1 5 8
4 4 8
2 2 4
2 5 9
1 5 8
4 4 8
1 1 2
2 5 9
1 5 8
3 3 6
3 3 6
2 5 9
1 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #163:

score: 0
Accepted
time: 13ms
memory: 3660kb

input:

20
2 5 9
1 5 8
2 5 5
1 4 5
2 5 9
1 5 8
2 5 5
2 2 4
2 5 9
4 4 8
3 3 6
3 3 6
2 5 9
4 4 8
3 3 6
1 2 5
2 5 9
4 4 8
2 5 5
1 2 5
2 5 9
4 4 8
2 5 5
1 1 2
2 5 9
4 4 8
1 4 5
1 4 5
2 5 9
4 4 8
1 4 5
1 2 5
2 5 9
4 4 8
1 4 5
2 2 4
2 5 9
4 4 8
1 4 5
1 1 2
2 5 9
4 4 8
1 2 5
2 2 4
2 5 9
3 3 6
3 3 6
3 3 6
2 5 9
3 3...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #164:

score: 0
Accepted
time: 39ms
memory: 3592kb

input:

20
2 5 9
3 3 6
2 5 5
2 2 4
2 5 9
3 3 6
2 5 5
1 1 2
2 5 9
3 3 6
1 4 5
1 4 5
2 5 9
3 3 6
1 4 5
2 2 4
2 5 9
4 5 5
2 5 5
1 2 5
2 5 9
4 5 5
2 5 5
1 1 2
2 5 9
4 5 5
1 4 5
1 4 5
2 5 9
4 5 5
1 4 5
1 2 5
2 5 9
4 5 5
1 4 5
2 2 4
2 5 9
4 5 5
1 4 5
1 1 2
2 5 9
4 5 5
1 2 5
2 2 4
2 5 9
4 5 5
2 2 4
2 2 4
2 5 9
4 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #165:

score: 0
Accepted
time: 19ms
memory: 3628kb

input:

20
5 8 9
5 8 9
5 8 9
1 1 2
5 8 9
5 8 9
2 5 9
2 5 9
5 8 9
5 8 9
2 5 9
4 4 8
5 8 9
5 8 9
2 5 9
3 3 6
5 8 9
5 8 9
1 5 8
1 5 8
5 8 9
5 8 9
1 5 8
3 3 6
5 8 9
5 8 9
1 5 8
1 4 5
5 8 9
5 8 9
1 5 8
2 2 4
5 8 9
5 8 9
4 4 8
3 3 6
5 8 9
5 8 9
4 4 8
1 4 5
5 8 9
5 8 9
4 4 8
1 2 5
5 8 9
5 8 9
4 4 8
2 2 4
5 8 9
5 8...

output:

0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #166:

score: 0
Accepted
time: 35ms
memory: 3756kb

input:

20
5 8 9
2 5 9
4 4 8
4 4 8
5 8 9
2 5 9
4 4 8
3 3 6
5 8 9
2 5 9
1 2 5
1 2 5
5 8 9
2 5 9
1 2 5
1 1 2
5 8 9
2 5 9
1 1 2
1 1 2
5 8 9
1 5 8
1 5 8
1 2 5
5 8 9
1 5 8
1 5 8
1 1 2
5 8 9
1 5 8
4 4 8
4 4 8
5 8 9
1 5 8
4 4 8
4 5 5
5 8 9
1 5 8
1 4 5
1 2 5
5 8 9
1 5 8
1 4 5
1 1 2
5 8 9
1 5 8
1 2 5
1 2 5
5 8 9
1 5...

output:

0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #167:

score: 0
Accepted
time: 24ms
memory: 3612kb

input:

20
5 8 9
4 4 8
3 3 6
3 3 6
5 8 9
4 4 8
3 3 6
4 5 5
5 8 9
4 4 8
3 3 6
2 5 5
5 8 9
4 4 8
4 5 5
1 4 5
5 8 9
4 4 8
4 5 5
2 2 4
5 8 9
3 3 6
3 3 6
1 2 5
5 8 9
3 3 6
3 3 6
1 1 2
5 8 9
3 3 6
1 2 5
1 2 5
5 8 9
3 3 6
1 2 5
1 1 2
5 8 9
2 5 5
1 2 5
1 2 5
5 8 9
2 5 5
1 2 5
1 1 2
5 8 9
2 5 5
1 1 2
1 1 2
5 8 9
1 4...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #168:

score: 0
Accepted
time: 21ms
memory: 3596kb

input:

20
5 8 9
1 2 5
2 2 4
2 2 4
5 8 9
1 2 5
2 2 4
1 1 2
5 5 10
5 5 10
5 5 10
5 8 9
5 5 10
5 5 10
5 8 9
2 5 9
5 5 10
5 5 10
5 8 9
4 4 8
5 5 10
5 5 10
5 8 9
4 5 5
5 5 10
5 5 10
1 5 8
4 4 8
5 5 10
5 8 9
5 8 9
1 4 5
5 5 10
5 8 9
5 8 9
2 2 4
5 5 10
5 8 9
5 8 9
1 1 2
5 5 10
5 8 9
2 5 9
4 4 8
5 5 10
5 8 9
1 5 8...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #169:

score: 0
Accepted
time: 37ms
memory: 3936kb

input:

20
5 5 10
2 5 9
1 4 5
1 2 5
5 5 10
2 5 9
1 4 5
1 1 2
5 5 10
2 5 9
1 2 5
1 2 5
5 5 10
2 5 9
1 2 5
2 2 4
5 5 10
2 5 9
1 2 5
1 1 2
5 5 10
2 5 9
2 2 4
1 1 2
5 5 10
2 5 9
1 1 2
1 1 2
5 5 10
1 5 8
1 5 8
1 5 8
5 5 10
1 5 8
1 5 8
1 4 5
5 5 10
1 5 8
1 5 8
1 2 5
5 5 10
1 5 8
1 5 8
2 2 4
5 5 10
1 5 8
1 5 8
1 1...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #170:

score: 0
Accepted
time: 7ms
memory: 3660kb

input:

20
5 5 10
1 5 8
1 4 5
1 1 2
5 5 10
1 5 8
1 2 5
2 2 4
5 5 10
1 5 8
2 2 4
2 2 4
5 5 10
1 5 8
2 2 4
1 1 2
5 5 10
4 4 8
4 4 8
4 4 8
5 5 10
4 4 8
4 4 8
3 3 6
5 5 10
4 4 8
4 4 8
4 5 5
5 5 10
4 4 8
4 4 8
2 5 5
5 5 10
4 4 8
1 2 5
1 2 5
5 5 10
4 4 8
1 2 5
1 1 2
5 5 10
4 4 8
1 1 2
1 1 2
5 5 10
3 3 6
3 3 6
1 4...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #171:

score: 0
Accepted
time: 36ms
memory: 3760kb

input:

20
5 5 10
3 3 6
2 2 4
1 1 2
5 5 10
3 3 6
1 1 2
1 1 2
5 5 10
4 5 5
1 2 5
1 2 5
5 5 10
4 5 5
1 2 5
1 1 2
5 5 10
4 5 5
1 1 2
1 1 2
5 5 10
2 5 5
1 4 5
1 2 5
5 5 10
2 5 5
1 4 5
1 1 2
5 5 10
2 5 5
1 2 5
1 2 5
5 5 10
2 5 5
1 2 5
2 2 4
5 5 10
2 5 5
1 2 5
1 1 2
5 5 10
2 5 5
2 2 4
1 1 2
5 5 10
2 5 5
1 1 2
1 1...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #172:

score: 0
Accepted
time: 24ms
memory: 3736kb

input:

20
5 5 10
2 2 4
2 2 4
2 2 4
5 5 10
2 2 4
2 2 4
1 1 2
2 4 10
2 4 10
5 5 10
1 5 8
2 4 10
2 4 10
5 5 10
1 4 5
2 4 10
2 4 10
5 5 10
1 2 5
2 4 10
2 4 10
5 5 10
2 2 4
2 4 10
2 4 10
5 5 10
1 1 2
2 4 10
2 4 10
4 5 5
2 5 5
2 4 10
2 4 10
4 5 5
1 4 5
2 4 10
2 4 10
2 5 5
2 5 5
2 4 10
5 5 10
5 8 9
4 4 8
2 4 10
5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #173:

score: 0
Accepted
time: 24ms
memory: 3656kb

input:

20
2 4 10
5 5 10
3 3 6
1 1 2
2 4 10
5 5 10
2 5 5
1 2 5
2 4 10
5 5 10
2 5 5
1 1 2
2 4 10
5 5 10
1 4 5
1 4 5
2 4 10
5 5 10
1 4 5
1 2 5
2 4 10
5 5 10
1 4 5
2 2 4
2 4 10
5 5 10
1 4 5
1 1 2
2 4 10
5 5 10
1 2 5
2 2 4
2 4 10
5 5 10
2 2 4
2 2 4
2 4 10
5 5 10
2 2 4
1 1 2
2 4 10
5 8 9
4 4 8
4 4 8
2 4 10
5 8 9...

output:

0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #174:

score: 0
Accepted
time: 24ms
memory: 3716kb

input:

20
2 4 10
2 5 9
4 5 5
1 4 5
2 4 10
2 5 9
4 5 5
1 2 5
2 4 10
2 5 9
4 5 5
2 2 4
2 4 10
2 5 9
4 5 5
1 1 2
2 4 10
2 5 9
2 5 5
2 5 5
2 4 10
2 5 9
2 5 5
1 4 5
2 4 10
2 5 9
2 5 5
2 2 4
2 4 10
1 5 8
1 5 8
4 5 5
2 4 10
1 5 8
4 4 8
2 5 5
2 4 10
1 5 8
4 4 8
1 4 5
2 4 10
1 5 8
3 3 6
4 5 5
2 4 10
1 5 8
3 3 6
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #175:

score: 0
Accepted
time: 17ms
memory: 3876kb

input:

20
2 4 10
4 4 8
2 5 5
1 2 5
2 4 10
4 4 8
2 5 5
2 2 4
2 4 10
4 4 8
2 5 5
1 1 2
2 4 10
4 4 8
1 4 5
1 4 5
2 4 10
3 3 6
3 3 6
4 5 5
2 4 10
3 3 6
3 3 6
2 5 5
2 4 10
3 3 6
4 5 5
1 4 5
2 4 10
3 3 6
4 5 5
1 2 5
2 4 10
3 3 6
4 5 5
2 2 4
2 4 10
3 3 6
4 5 5
1 1 2
2 4 10
3 3 6
2 5 5
2 5 5
2 4 10
3 3 6
2 5 5
1 4...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #176:

score: 0
Accepted
time: 35ms
memory: 3880kb

input:

20
2 4 10
4 5 5
1 4 5
2 2 4
2 4 10
4 5 5
2 2 4
2 2 4
2 4 10
2 5 5
2 5 5
2 5 5
2 4 10
2 5 5
2 5 5
1 4 5
2 4 10
2 5 5
2 5 5
2 2 4
2 8 10
2 8 10
2 8 10
5 5 10
2 8 10
2 8 10
2 8 10
4 5 5
2 8 10
2 8 10
2 4 10
5 8 9
2 8 10
2 8 10
5 5 10
2 5 9
2 8 10
2 8 10
5 5 10
4 4 8
2 8 10
2 8 10
5 5 10
3 3 6
2 8 10
2 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #177:

score: 0
Accepted
time: 26ms
memory: 3696kb

input:

20
2 8 10
2 8 10
1 5 8
1 2 5
2 8 10
2 8 10
4 4 8
4 5 5
2 8 10
2 8 10
4 5 5
4 5 5
2 8 10
2 8 10
1 4 5
1 2 5
2 8 10
2 8 10
1 2 5
1 2 5
2 8 10
2 4 10
5 5 10
5 8 9
2 8 10
2 4 10
5 8 9
4 4 8
2 8 10
2 4 10
2 5 9
1 4 5
2 8 10
2 4 10
1 5 8
2 5 5
2 8 10
2 4 10
1 5 8
1 4 5
2 8 10
2 4 10
3 3 6
3 3 6
2 8 10
2 4...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #178:

score: 0
Accepted
time: 25ms
memory: 3708kb

input:

20
2 8 10
5 5 10
5 8 9
5 8 9
2 8 10
5 5 10
5 8 9
2 5 9
2 8 10
5 5 10
5 8 9
1 5 8
2 8 10
5 5 10
5 8 9
1 4 5
2 8 10
5 5 10
5 8 9
1 2 5
2 8 10
5 5 10
5 8 9
2 2 4
2 8 10
5 5 10
5 8 9
1 1 2
2 8 10
5 5 10
2 5 9
4 4 8
2 8 10
5 5 10
4 4 8
4 4 8
2 8 10
5 5 10
4 4 8
3 3 6
2 8 10
5 5 10
4 4 8
4 5 5
2 8 10
5 5 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #179:

score: 0
Accepted
time: 17ms
memory: 3624kb

input:

20
2 8 10
5 8 9
5 8 9
1 1 2
2 8 10
5 8 9
2 5 9
4 4 8
2 8 10
5 8 9
2 5 9
3 3 6
2 8 10
5 8 9
1 5 8
4 4 8
2 8 10
5 8 9
1 5 8
4 5 5
2 8 10
5 8 9
4 4 8
3 3 6
2 8 10
5 8 9
4 4 8
2 5 5
2 8 10
5 8 9
4 4 8
1 4 5
2 8 10
5 8 9
4 4 8
2 2 4
2 8 10
5 8 9
3 3 6
3 3 6
2 8 10
5 8 9
3 3 6
4 5 5
2 8 10
5 8 9
3 3 6
2 5...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #180:

score: 0
Accepted
time: 23ms
memory: 3680kb

input:

20
2 8 10
2 5 9
1 5 8
1 1 2
2 8 10
2 5 9
3 3 6
3 3 6
2 8 10
2 5 9
3 3 6
1 2 5
2 8 10
2 5 9
2 5 5
1 2 5
2 8 10
2 5 9
2 5 5
1 1 2
2 8 10
2 5 9
1 4 5
1 4 5
2 8 10
2 5 9
1 4 5
1 2 5
2 8 10
2 5 9
1 4 5
2 2 4
2 8 10
2 5 9
1 4 5
1 1 2
2 8 10
2 5 9
1 2 5
2 2 4
2 8 10
1 5 8
1 5 8
1 5 8
2 8 10
1 5 8
1 5 8
3 3...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #181:

score: 0
Accepted
time: 13ms
memory: 3624kb

input:

20
2 8 10
1 5 8
4 5 5
1 1 2
2 8 10
1 5 8
2 5 5
1 4 5
2 8 10
1 5 8
2 5 5
1 2 5
2 8 10
1 5 8
2 5 5
2 2 4
2 8 10
1 5 8
2 5 5
1 1 2
2 8 10
1 5 8
1 4 5
1 4 5
2 8 10
1 5 8
1 4 5
2 2 4
2 8 10
4 4 8
4 4 8
4 5 5
2 8 10
4 4 8
4 5 5
4 5 5
2 8 10
4 4 8
1 4 5
1 2 5
2 8 10
4 4 8
1 2 5
1 2 5
2 8 10
3 3 6
3 3 6
3 3...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #182:

score: 0
Accepted
time: 15ms
memory: 3852kb

input:

20
2 8 10
4 5 5
1 4 5
1 1 2
2 8 10
4 5 5
1 2 5
1 2 5
2 8 10
4 5 5
1 2 5
2 2 4
2 8 10
4 5 5
1 2 5
1 1 2
2 8 10
4 5 5
2 2 4
1 1 2
2 8 10
4 5 5
1 1 2
1 1 2
2 8 10
2 5 5
2 5 5
1 2 5
2 8 10
2 5 5
2 5 5
1 1 2
2 8 10
2 5 5
1 4 5
1 4 5
2 8 10
2 5 5
1 4 5
1 2 5
2 8 10
2 5 5
1 4 5
2 2 4
2 8 10
2 5 5
1 4 5
1 1...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #183:

score: 0
Accepted
time: 14ms
memory: 3756kb

input:

20
4 10 10
4 10 10
4 10 10
2 5 5
4 10 10
4 10 10
4 10 10
1 4 5
4 10 10
4 10 10
2 8 10
5 5 10
4 10 10
4 10 10
2 8 10
4 5 5
4 10 10
4 10 10
2 4 10
5 8 9
4 10 10
4 10 10
5 5 10
2 5 9
4 10 10
4 10 10
5 5 10
4 4 8
4 10 10
4 10 10
5 5 10
3 3 6
4 10 10
4 10 10
5 5 10
4 5 5
4 10 10
4 10 10
5 5 10
2 5 5
4 10...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #184:

score: 0
Accepted
time: 20ms
memory: 3704kb

input:

20
4 10 10
2 8 10
2 8 10
1 5 8
4 10 10
2 8 10
2 8 10
3 3 6
4 10 10
2 8 10
2 8 10
2 5 5
4 10 10
2 8 10
2 8 10
1 4 5
4 10 10
2 8 10
5 5 10
5 5 10
4 10 10
2 8 10
5 5 10
5 8 9
4 10 10
2 8 10
5 5 10
1 5 8
4 10 10
2 8 10
5 8 9
4 4 8
4 10 10
2 8 10
5 8 9
4 5 5
4 10 10
2 8 10
5 8 9
1 1 2
4 10 10
2 8 10
2 5 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #185:

score: 0
Accepted
time: 11ms
memory: 3620kb

input:

20
4 10 10
5 5 10
5 8 9
3 3 6
4 10 10
5 5 10
5 8 9
4 5 5
4 10 10
5 5 10
5 8 9
2 5 5
4 10 10
5 5 10
1 5 8
4 4 8
4 10 10
5 8 9
4 4 8
4 4 8
4 10 10
5 8 9
4 4 8
1 1 2
4 10 10
2 5 9
4 4 8
4 4 8
4 10 10
1 5 8
4 4 8
4 4 8
4 10 10
1 5 8
1 4 5
1 2 5
4 10 10
1 5 8
1 4 5
1 1 2
4 10 10
4 4 8
4 4 8
3 3 6
4 10 10...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #186:

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

input:

20
4 10 10
1 4 5
1 2 5
1 2 5
4 10 10
1 4 5
1 2 5
2 2 4
4 10 10
1 4 5
1 2 5
1 1 2
8 10 10
8 10 10
2 8 10
1 2 5
8 10 10
8 10 10
2 8 10
1 1 2
8 10 10
8 10 10
2 4 10
2 5 9
8 10 10
8 10 10
2 4 10
1 5 8
8 10 10
8 10 10
2 4 10
3 3 6
8 10 10
8 10 10
2 4 10
2 5 5
8 10 10
8 10 10
2 4 10
1 4 5
8 10 10
8 10 10
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #187:

score: 0
Accepted
time: 7ms
memory: 3872kb

input:

20
8 10 10
8 10 10
4 4 8
1 2 5
8 10 10
8 10 10
4 4 8
1 1 2
8 10 10
8 10 10
3 3 6
1 4 5
8 10 10
8 10 10
3 3 6
1 2 5
8 10 10
8 10 10
3 3 6
2 2 4
8 10 10
8 10 10
3 3 6
1 1 2
8 10 10
8 10 10
4 5 5
1 2 5
8 10 10
8 10 10
4 5 5
1 1 2
8 10 10
8 10 10
2 5 5
1 4 5
8 10 10
8 10 10
2 5 5
1 2 5
8 10 10
8 10 10
2...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #188:

score: 0
Accepted
time: 13ms
memory: 3884kb

input:

20
8 10 10
4 10 10
2 8 10
1 4 5
8 10 10
4 10 10
2 4 10
5 5 10
8 10 10
4 10 10
2 4 10
4 5 5
8 10 10
4 10 10
5 5 10
1 5 8
8 10 10
4 10 10
5 5 10
1 4 5
8 10 10
4 10 10
5 5 10
1 2 5
8 10 10
4 10 10
5 5 10
2 2 4
8 10 10
4 10 10
5 5 10
1 1 2
8 10 10
4 10 10
5 8 9
1 2 5
8 10 10
4 10 10
5 8 9
1 1 2
8 10 10
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #189:

score: 0
Accepted
time: 17ms
memory: 3644kb

input:

20
8 10 10
4 10 10
3 3 6
3 3 6
8 10 10
4 10 10
3 3 6
4 5 5
8 10 10
4 10 10
3 3 6
2 5 5
8 10 10
4 10 10
4 5 5
2 5 5
8 10 10
4 10 10
4 5 5
1 4 5
8 10 10
4 10 10
4 5 5
2 2 4
8 10 10
4 10 10
2 5 5
2 5 5
8 10 10
2 8 10
2 8 10
5 5 10
8 10 10
2 8 10
2 8 10
4 5 5
8 10 10
2 8 10
2 8 10
1 2 5
8 10 10
2 8 10
2...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 20 lines

Test #190:

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

input:

20
1 1 2
1 1 2
1 1 2
1 1 2
1 4 5
1 4 5
1 4 5
1 4 5
2 5 5
1 4 5
1 4 5
1 1 2
4 5 5
2 5 5
1 4 5
1 2 5
4 5 5
1 4 5
1 2 5
1 1 2
4 4 8
1 4 5
1 2 5
1 1 2
4 4 8
2 2 4
1 1 2
1 1 2
1 5 8
1 5 8
1 4 5
1 4 5
1 5 8
4 4 8
1 2 5
1 1 2
1 5 8
1 4 5
2 2 4
2 2 4
5 8 9
5 8 9
2 5 9
2 5 9
5 8 9
5 8 9
1 5 8
1 5 8
5 8 9
1 5...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #191:

score: 0
Accepted
time: 3ms
memory: 3648kb

input:

20
5 10 13
4 9 13
1 9 10
1 4 5
9 10 13
5 10 13
4 9 13
4 5 13
9 10 13
5 10 13
1 9 10
1 5 10
9 10 13
1 10 13
1 9 10
1 9 10
9 10 13
4 9 13
1 5 10
1 4 5
9 10 13
4 9 13
2 4 10
1 1 2
9 10 13
1 8 13
1 9 10
4 4 8
9 10 13
4 5 13
1 9 10
1 4 5
2 13 13
4 9 13
4 9 13
1 1 2
8 8 16
1 9 10
2 8 10
1 1 2
8 8 16
1 5 1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #192:

score: 0
Accepted
time: 3ms
memory: 3676kb

input:

20
10 13 17
8 13 17
1 10 13
1 8 13
9 9 18
4 9 13
1 8 13
1 1 2
9 9 18
4 9 13
2 5 13
1 5 8
9 9 18
1 9 10
2 8 10
2 2 4
9 9 18
1 9 10
2 4 10
4 4 8
9 9 18
5 8 9
1 4 5
1 1 2
9 9 18
5 8 9
1 2 5
2 2 4
9 9 18
2 5 9
2 5 9
2 5 5
9 9 18
2 5 9
1 5 8
4 5 5
9 9 18
2 5 9
4 4 8
1 4 5
4 10 18
4 10 18
1 9 10
1 9 10
4 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #193:

score: 0
Accepted
time: 3ms
memory: 3680kb

input:

20
1 13 18
9 9 18
4 5 13
1 4 5
1 13 18
4 9 13
5 8 9
2 5 9
17 17 18
5 17 18
5 17 18
5 5 18
17 17 18
5 17 18
4 17 17
4 5 17
17 17 18
9 9 18
1 16 17
1 16 17
4 16 20
13 13 16
5 13 16
4 5 13
16 20 20
4 16 20
5 5 16
4 5 5
2 18 20
17 17 18
5 17 18
5 8 17
5 9 20
16 20 20
4 16 20
1 4 5
5 9 20
10 10 20
1 9 10...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #194:

score: 0
Accepted
time: 3ms
memory: 3596kb

input:

20
5 20 25
13 17 20
9 17 20
4 5 13
5 20 25
5 9 20
16 20 20
4 16 20
5 20 25
16 20 20
8 20 20
1 5 8
20 25 25
5 20 25
1 13 20
5 13 16
20 25 25
5 20 25
5 9 20
4 5 5
20 25 25
5 20 25
4 16 20
1 4 5
20 25 25
5 20 25
4 8 20
5 8 9
9 16 25
9 16 25
1 16 17
1 16 17
9 16 25
5 20 25
5 20 25
4 16 20
9 16 25
5 20 2...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #195:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

20
16 17 25
4 13 25
1 16 17
4 9 13
16 17 25
9 10 25
1 16 17
1 9 10
16 17 25
5 20 25
5 20 25
1 17 20
1 18 25
16 17 25
9 9 18
1 16 17
13 18 25
13 18 25
8 13 25
8 13 25
13 18 25
13 18 25
1 13 18
1 13 18
13 18 25
1 13 18
10 16 18
4 10 18
13 18 25
1 13 18
9 9 18
9 9 18
1 20 25
1 20 25
9 16 25
9 16 25
1 2...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #196:

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

input:

20
5 17 26
8 18 26
2 18 20
5 17 18
17 25 26
13 25 26
5 17 26
5 13 26
17 25 26
13 25 26
4 17 25
4 13 25
17 20 29
13 20 29
10 17 29
10 13 29
17 20 29
13 20 29
1 17 20
1 13 20
17 20 29
5 16 29
5 20 25
1 17 20
9 26 29
9 26 29
4 25 29
4 25 29
25 26 29
9 26 29
8 25 29
8 9 29
25 26 29
9 26 29
5 25 26
5 9 2...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #197:

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

input:

20
16 16 32
10 16 18
1 5 10
2 5 9
16 16 32
9 9 18
1 16 17
2 9 17
16 16 32
9 9 18
2 10 16
1 9 10
16 16 32
1 16 17
5 8 17
5 8 9
16 16 32
8 8 16
5 8 9
1 5 8
4 20 32
16 16 32
1 17 20
1 16 17
4 20 32
16 16 32
1 13 20
4 9 13
4 20 32
16 16 32
5 9 20
1 4 5
4 20 32
16 16 32
5 5 16
4 5 5
26 26 32
16 16 32
1 2...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #198:

score: 0
Accepted
time: 2ms
memory: 3600kb

input:

20
1 25 32
9 17 32
9 16 25
1 16 17
1 25 32
4 20 32
9 16 25
4 16 20
1 25 32
16 16 32
1 20 25
4 16 20
1 25 32
16 16 32
1 18 25
9 9 18
1 25 32
16 16 32
4 17 25
1 16 17
1 25 32
16 16 32
4 13 25
4 9 13
1 25 32
16 16 32
9 10 25
1 9 10
1 25 32
9 16 25
10 16 18
2 10 16
1 25 32
9 16 25
8 8 16
8 8 16
17 25 32...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #199:

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

input:

20
5 17 34
17 17 34
4 17 17
4 5 17
1 25 34
17 17 34
10 17 25
1 10 17
9 25 34
9 25 34
8 34 34
4 4 8
9 25 34
9 25 34
4 26 34
4 26 34
9 25 34
9 25 34
4 25 29
4 25 29
9 25 34
20 26 34
1 25 26
4 16 20
9 25 34
16 26 34
1 26 29
4 25 29
9 25 34
16 26 34
1 25 26
4 26 26
9 25 34
4 26 34
9 26 29
4 25 29
1 29 3...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #200:

score: 0
Accepted
time: 4ms
memory: 3628kb

input:

20
25 29 34
9 13 34
4 25 29
4 9 13
25 29 34
4 26 34
4 25 29
1 25 26
25 29 34
4 18 34
4 25 29
9 9 18
25 29 34
10 16 34
4 25 29
1 9 10
18 18 36
1 25 26
8 18 26
1 1 2
18 18 36
1 17 26
8 18 26
2 17 25
18 18 36
5 9 26
8 18 26
2 5 9
18 18 36
13 18 25
1 8 13
1 1 2
18 18 36
13 18 25
2 5 13
1 5 8
18 18 36
2 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #201:

score: 0
Accepted
time: 3ms
memory: 3620kb

input:

20
8 20 36
18 18 36
5 5 18
2 5 5
8 20 36
13 18 25
2 18 20
1 13 18
8 20 36
2 18 20
9 9 18
9 9 18
20 32 36
17 25 32
9 17 32
4 20 32
2 26 36
8 18 26
13 18 25
1 13 18
2 26 36
8 18 26
9 9 18
9 9 18
13 13 36
18 18 36
1 13 18
1 13 18
5 17 36
18 18 36
2 18 20
5 8 17
5 17 36
18 18 36
5 17 18
5 5 18
25 25 36
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #202:

score: 0
Accepted
time: 2ms
memory: 3888kb

input:

20
5 25 40
20 20 40
5 9 20
4 5 5
5 25 40
20 20 40
4 16 20
1 4 5
5 25 40
20 20 40
4 8 20
5 8 9
4 20 40
20 20 40
5 20 25
5 9 20
9 13 40
20 20 40
5 20 25
4 5 13
9 13 40
20 20 40
5 13 20
5 9 20
5 17 40
20 20 40
9 17 20
5 9 20
13 17 40
20 20 40
1 17 20
1 13 20
1 29 40
20 20 40
13 20 29
1 13 20
1 29 40
20...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #203:

score: 0
Accepted
time: 2ms
memory: 3740kb

input:

20
25 26 41
16 25 41
5 9 26
1 4 5
25 26 41
16 25 41
2 16 26
1 1 2
25 26 41
16 25 41
4 10 26
1 9 10
25 26 41
4 25 41
1 25 26
9 16 25
25 26 41
9 20 41
1 25 26
4 16 20
25 26 41
16 17 41
1 25 26
1 16 17
4 29 41
25 26 41
4 25 29
1 25 26
4 29 41
16 25 41
1 29 34
9 25 34
4 29 41
16 25 41
9 26 29
1 25 26
10...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #204:

score: 0
Accepted
time: 3ms
memory: 3948kb

input:

20
37 40 41
13 40 41
9 37 40
9 13 40
37 40 41
10 37 41
9 37 40
9 10 37
37 40 41
16 25 41
4 36 40
1 36 37
2 41 41
16 25 41
16 25 41
1 1 2
9 36 45
29 36 41
9 20 41
5 29 36
9 36 45
20 32 36
20 32 36
5 9 20
36 45 45
9 36 45
5 17 36
9 17 20
36 45 45
9 36 45
8 20 36
5 8 9
10 25 45
36 45 45
9 36 45
1 9 10
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #205:

score: 0
Accepted
time: 4ms
memory: 3680kb

input:

20
16 37 45
25 40 45
4 36 40
1 36 37
16 37 45
9 36 45
9 37 40
4 36 40
34 37 45
16 37 45
13 34 45
13 16 45
34 37 45
16 37 45
5 34 37
5 16 37
34 37 45
13 34 45
5 34 37
5 13 34
34 37 45
9 36 45
1 36 37
9 25 34
1 40 45
25 40 45
9 36 45
9 36 45
1 40 45
36 45 45
9 36 45
4 36 40
25 32 49
25 32 49
18 25 49
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #206:

score: 0
Accepted
time: 3ms
memory: 3652kb

input:

20
25 25 50
9 25 34
2 20 34
4 20 32
25 25 50
9 25 34
4 18 34
4 4 8
25 25 50
9 25 34
8 10 34
4 10 18
25 25 50
5 29 32
4 25 29
2 5 9
25 25 50
17 25 32
1 16 17
1 1 2
25 25 50
17 25 32
1 10 17
2 10 16
25 25 50
17 25 32
2 9 17
2 2 4
25 25 50
17 25 32
4 5 17
2 5 9
25 25 50
1 25 32
16 17 25
2 17 25
25 25 5...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #207:

score: 0
Accepted
time: 3ms
memory: 3824kb

input:

20
25 25 50
13 18 25
5 13 16
1 5 8
25 25 50
13 18 25
8 8 16
1 8 13
25 25 50
13 18 25
4 9 13
4 4 8
25 25 50
13 18 25
4 5 13
5 8 9
25 25 50
2 17 25
2 17 25
17 17 18
25 25 50
2 17 25
8 13 25
8 13 17
25 25 50
8 13 25
8 13 25
2 13 13
25 25 50
8 13 25
1 13 18
13 13 16
25 25 50
8 13 25
10 16 18
1 10 13
25 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #208:

score: 0
Accepted
time: 1ms
memory: 3648kb

input:

20
16 26 50
25 25 50
4 10 26
1 9 10
16 26 50
17 25 32
1 25 26
2 17 25
16 26 50
1 25 26
13 18 25
8 13 25
4 34 50
4 34 50
9 25 34
9 25 34
4 34 50
16 26 50
9 25 34
1 25 26
4 34 50
25 25 50
1 29 34
4 25 29
4 34 50
25 25 50
1 25 34
9 16 25
4 34 50
25 25 50
9 13 34
4 9 13
4 34 50
25 25 50
4 26 34
1 25 26
...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #209:

score: 0
Accepted
time: 1ms
memory: 3676kb

input:

20
5 29 50
25 25 50
8 25 29
5 8 25
9 29 50
9 29 50
4 25 29
4 25 29
9 29 50
4 34 50
9 25 34
4 25 29
9 29 50
16 26 50
4 25 29
1 25 26
9 29 50
25 25 50
1 26 29
1 25 26
9 29 50
25 25 50
1 20 29
4 16 20
9 29 50
25 25 50
5 16 29
1 4 5
9 29 50
25 25 50
4 13 29
4 9 13
9 29 50
25 25 50
8 9 29
4 4 8
9 29 50
1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #210:

score: 0
Accepted
time: 3ms
memory: 3624kb

input:

20
1 41 50
25 25 50
1 32 41
16 16 32
1 41 50
25 25 50
4 29 41
4 25 29
1 41 50
25 25 50
9 26 41
1 25 26
1 41 50
25 25 50
4 25 41
9 16 25
1 41 50
25 25 50
9 20 41
4 16 20
1 41 50
25 25 50
16 17 41
1 16 17
1 41 50
16 25 41
17 25 32
2 17 25
1 41 50
16 25 41
13 18 25
8 13 25
29 41 50
25 41 50
13 29 50
13...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #211:

score: 0
Accepted
time: 1ms
memory: 3716kb

input:

20
16 36 52
25 25 36
13 25 36
4 13 25
36 40 52
16 36 52
1 37 40
1 36 37
36 40 52
16 36 52
1 29 40
4 25 29
36 40 52
16 36 52
9 13 40
4 9 13
36 40 52
16 36 52
5 25 40
1 4 5
36 40 52
4 36 40
13 13 36
13 13 16
13 17 52
26 26 52
5 17 26
5 13 26
5 25 52
26 26 52
13 25 26
5 13 26
9 25 52
36 40 52
4 36 40
9...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #212:

score: 0
Accepted
time: 3ms
memory: 3872kb

input:

20
29 37 52
25 37 52
2 29 37
2 25 37
29 37 52
16 36 52
1 36 37
4 25 29
1 41 52
36 40 52
16 25 41
4 36 40
1 41 52
26 26 52
17 26 41
1 17 26
1 45 52
36 40 52
9 36 45
4 36 40
1 45 52
16 36 52
25 40 45
4 36 40
13 45 52
16 36 52
9 36 45
4 9 13
45 49 52
17 49 52
13 45 52
13 17 52
45 49 52
17 49 52
10 45 4...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #213:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

20
50 53 53
16 53 53
13 50 53
13 16 53
50 53 53
13 50 53
13 50 53
13 13 50
50 53 53
13 50 53
13 32 53
2 50 52
50 53 53
4 49 53
4 49 53
25 25 50
16 18 58
29 29 58
5 18 29
5 16 29
10 20 58
29 29 58
13 20 29
10 13 29
8 26 58
29 29 58
9 26 29
8 9 29
20 26 58
29 29 58
1 26 29
1 20 29
10 32 58
29 29 58
5 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #214:

score: 0
Accepted
time: 2ms
memory: 3676kb

input:

20
9 49 58
9 49 58
32 58 58
16 16 32
9 49 58
9 49 58
16 50 58
16 50 58
9 49 58
36 58 58
16 50 58
1 49 50
9 49 58
50 52 58
16 36 52
1 49 50
25 53 58
25 53 58
4 49 53
4 49 53
25 53 58
9 49 58
16 53 53
4 49 53
41 53 58
25 53 58
13 41 58
13 25 58
41 53 58
25 53 58
8 41 53
8 25 53
41 53 58
9 49 58
4 49 5...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #215:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

20
36 37 61
25 36 61
9 10 37
1 9 10
36 37 61
9 34 61
1 36 37
9 25 34
36 37 61
16 29 61
1 36 37
4 25 29
36 37 61
25 26 61
1 36 37
1 25 26
9 40 61
36 37 61
4 36 40
1 36 37
9 40 61
25 36 61
1 40 45
9 36 45
9 40 61
25 36 61
9 37 40
1 36 37
17 40 61
25 36 61
4 36 40
1 16 17
4 41 61
36 37 61
16 25 41
1 36...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #216:

score: 0
Accepted
time: 3ms
memory: 3668kb

input:

20
1 52 61
25 36 61
25 37 52
1 36 37
5 52 61
25 36 61
16 36 52
1 4 5
50 53 61
20 53 61
17 50 61
17 20 61
50 53 61
20 53 61
9 50 53
9 20 53
50 53 61
17 50 61
9 50 53
9 17 50
50 53 61
25 36 61
4 49 53
1 49 50
2 61 61
25 36 61
25 36 61
1 1 2
32 32 64
1 49 50
18 32 50
1 1 2
32 32 64
1 37 50
18 32 50
2 3...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #217:

score: 0
Accepted
time: 6ms
memory: 3876kb

input:

20
32 32 64
18 25 49
1 25 32
2 25 25
32 32 64
9 13 40
8 32 40
8 13 25
32 32 64
5 25 40
8 32 40
5 8 9
32 32 64
5 29 36
5 29 32
4 20 32
32 32 64
25 25 36
1 25 32
1 25 32
32 32 64
20 32 36
1 25 32
1 20 25
32 32 64
20 32 36
5 13 32
4 5 13
32 32 64
9 25 34
2 32 34
9 9 18
32 32 64
9 13 34
2 32 34
13 18 25...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines

Test #218:

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

input:

20
32 32 64
9 17 32
13 18 25
2 13 17
32 32 64
9 17 32
2 17 25
17 17 18
32 32 64
9 17 32
8 13 25
8 13 17
8 40 64
25 32 49
8 32 40
1 25 32
8 40 64
8 32 40
17 25 32
9 17 32
18 34 64
25 32 49
2 32 34
1 25 32
18 34 64
2 32 34
17 25 32
9 17 32
2 50 64
18 32 50
25 32 49
1 25 32
2 50 64
18 32 50
17 25 32
9 ...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 20 lines