QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#76522#5419. TrianglesmaspyAC ✓2ms3500kbC++2019.6kb2023-02-10 10:54:092023-02-10 10:54:09

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-10 10:54:09]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3500kb
  • [2023-02-10 10:54:09]
  • 提交

answer

#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;

template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
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); }
// (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, typename U>
T ceil(T x, U y) {
  return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
  return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

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

#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) {
  assert(!que.empty());
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  assert(!que.empty());
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng) {
  assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>

namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.write(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};

struct has_read_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.read(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};

struct Scanner {
  FILE *fp;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += fread(line + ed, 1, (1 << 15) - ed, fp);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
    if (neg) ref = -ref;
    return true;
  }
  template <typename T,
            typename enable_if<has_read<T>::value>::type * = nullptr>
  inline bool read_single(T &x) {
    x.read();
    return true;
  }
  bool read_single(double &ref) {
    string s;
    if (!read_single(s)) return false;
    ref = std::stod(s);
    return true;
  }
  bool read_single(char &ref) {
    string s;
    if (!read_single(s) || s.size() != 1) return false;
    ref = s[0];
    return true;
  }
  template <class T>
  bool read_single(vector<T> &ref) {
    for (auto &d: ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T, class U>
  bool read_single(pair<T, U> &p) {
    return (read_single(p.first) && read_single(p.second));
  }
  template <size_t N = 0, typename T>
  void read_single_tuple(T &t) {
    if constexpr (N < std::tuple_size<T>::value) {
      auto &x = std::get<N>(t);
      read_single(x);
      read_single_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool read_single(tuple<T...> &tpl) {
    read_single_tuple(tpl);
    return true;
  }
  void read() {}
  template <class H, class... T>
  void read(H &h, T &... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE *fp) : fp(fp) {}
};

struct Printer {
  Printer(FILE *_fp) : fp(_fp) {}
  ~Printer() { flush(); }

  static constexpr size_t SIZE = 1 << 15;
  FILE *fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write(const char val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write('0');
      return;
    }
    if (val < 0) {
      write('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
    pos += len;
  }
  void write(const string s) {
    for (char c: s) write(c);
  }
  void write(const char *s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write(s[i]);
  }
  void write(const double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  void write(const long double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  template <typename T,
            typename enable_if<has_write<T>::value>::type * = nullptr>
  inline void write(T x) {
    x.write();
  }
  template <class T>
  void write(const vector<T> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  template <class T, class U>
  void write(const pair<T, U> val) {
    write(val.first);
    write(' ');
    write(val.second);
  }
  template <size_t N = 0, typename T>
  void write_tuple(const T t) {
    if constexpr (N < std::tuple_size<T>::value) {
      if constexpr (N > 0) { write(' '); }
      const auto x = std::get<N>(t);
      write(x);
      write_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool write(tuple<T...> tpl) {
    write_tuple(tpl);
    return true;
  }
  template <class T, size_t S>
  void write(const array<T, S> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  void write(i128 val) {
    string s;
    bool negative = 0;
    if (val < 0) {
      negative = 1;
      val = -val;
    }
    while (val) {
      s += '0' + int(val % 10);
      val /= 10;
    }
    if (negative) s += "-";
    reverse(all(s));
    if (len(s) == 0) s = "0";
    write(s);
  }
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  printer.write(head);
  if (sizeof...(Tail)) printer.write(' ');
  print(forward<Tail>(tail)...);
}

void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
  scanner.read(head);
  read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __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 2 "library/geo/base.hpp"
template <typename T>
struct Point {
  T x, y;

  Point() = default;

  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+(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; }
  Point operator-() const { return {-x, -y}; }

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

  void read() { fastio::read(x), fastio::read(y); }
  void write() { fastio::printer.write(pair<T, T>({x, y})); }
};

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>
REAL dist(Point<T> A, Point<T> B) {
  A = A - B;
  T p = A.dot(A);
  return sqrt(REAL(p));
}

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;
  }

  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)) {}

  template <enable_if_t<is_integral<T>::value, int> = 0>
  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 T>
struct Circle {
  Point<T> O;
  T r;
  Circle(Point<T> O, T r) : O(O), r(r) {}
  Circle(T x, T y, T r) : O(Point<T>(x, y)), r(r) {}
};

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

  template <typename A, typename B>
  Polygon(vc<pair<A, B>> pairs) {
    for (auto&& [a, b]: pairs) points.eb(Point<T>(a, b));
    build();
  }
  Polygon(vc<Point<T>> points) : points(points) { build(); }

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

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

  template <enable_if_t<is_integral<T>::value, int> = 0>
  T area_2() {
    return a;
  }

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

private:
  void build() {
    a = 0;
    FOR(i, len(points)) {
      int j = (i + 1 == len(points) ? 0 : i + 1);
      a += points[i].det(points[j]);
    }
    if (a < 0) {
      a = -a;
      reverse(all(points));
    }
  }
};
#line 4 "main.cpp"

using P = Point<ll>;
using TRI = tuple<P, P, P>;

vc<TRI> f(ll N) {
  vc<TRI> dat;

  if (N % 3 == 2) {
    // https://proofwiki.org/wiki/Dissection_of_Square_into_8_Acute_Triangles
    const ll L = 10'000'000;
    P A(0, 0);
    P B(100 * L, 0);
    P C(100 * L, 100 * L);
    P D(0, 100 * L);
    P E(50 * L, 100 * L);
    P F(50 * L, 0);
    P G(41 * L, 80 * L);
    P H(59 * L, 80 * L);
    dat.eb(A, F, G);
    dat.eb(G, F, H);
    dat.eb(H, F, B);
    dat.eb(H, B, C);
    dat.eb(D, G, E);
    dat.eb(G, H, E);
    dat.eb(E, H, C);
    dat.eb(D, A, G);
  }
  if (N % 3 == 0) {
    // https://proofwiki.org/wiki/Dissection_of_Square_into_9_Acute_Triangles
    const ll L = 10'000'000;
    P A(0, 0);
    P B(0, 100 * L);
    P C(100 * L, 100 * L);
    P D(100 * L, 0);
    P E(64 * L, 36 * L);
    P F(48 * L, 27 * L);
    P G(55 * L, 0);
    P H(100 * L, 30 * L);
    P J(64 * L, 20 * L);
    dat.eb(A, E, B);
    dat.eb(B, E, C);
    dat.eb(A, G, F);
    dat.eb(F, G, J);
    dat.eb(F, J, E);
    dat.eb(G, D, J);
    dat.eb(J, H, E);
    dat.eb(J, D, H);
    dat.eb(E, H, C);
  }
  if (N % 3 == 1) {
    // https://mathworld.wolfram.com/SquareDissection.html
    const ll L = 10'000'000;
    P A(0, 0);
    P B(100 * L, 0);
    P C(100 * L, 100 * L);
    P D(0, 100 * L);
    P E(70 * L, 70 * L);
    P F(50 * L, 69 * L);
    P G(69 * L, 50 * L);
    P H(65 * L, 100 * L);
    P I(100 * L, 65 * L);
    dat.eb(A, B, G);
    dat.eb(A, G, F);
    dat.eb(A, F, D);
    dat.eb(D, F, H);
    dat.eb(H, F, E);
    dat.eb(E, F, G);
    dat.eb(E, G, I);
    dat.eb(I, G, B);
    dat.eb(H, E, C);
    dat.eb(C, E, I);
  }

  assert(N % 3 == len(dat) % 3);

  auto even = [&](P p) -> bool { return p.x % 2 == 0 && p.y % 2 == 0; };

  while (len(dat) < N) {
    FOR(i, len(dat)) {
      auto [A, B, C] = dat[i];
      if (even(A) && even(B) && even(C)) {
        P D((B.x + C.x) / 2, (B.y + C.y) / 2);
        P E((C.x + A.x) / 2, (C.y + A.y) / 2);
        P F((A.x + B.x) / 2, (A.y + B.y) / 2);
        dat[i] = {D, E, F};
        dat.eb(A, F, E);
        dat.eb(F, B, D);
        dat.eb(E, D, C);
        break;
      }
    }
  }
  return dat;
}

void test() {
  FOR(N, 8, 51) {
    auto dat = f(N);
    ll sm = 0;
    assert(len(dat) == N);
    for (auto [A, B, C]: dat) {
      ll det = (B - A).det(C - A);
      assert(det > 0);
      sm += det;
      FOR(3) {
        tie(A, B, C) = mt(B, C, A);
        ll dot = (B - A).dot(C - B);
        if (dot >= 0) {
          print(N, ",", A, B, C);
          flush();
        }
        assert(dot < 0);
      }
    }
    const ll L = 1'000'000'000;
    assert(sm == 2 * L * L);
  }
}

void solve() {
  LL(N);
  if (N <= 7) return No();
  auto dat = f(N);
  Yes();
  for (auto&& [A, B, C]: dat) { print(A, B, C); }
}

signed main() {
  // test();
  solve();
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3332kb

input:

2

output:

No

result:

ok no solution

Test #2:

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

input:

24

output:

Yes
220000000 467500000 200000000 456250000 220000000 436250000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 24 acute triangles

Test #3:

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

input:

1

output:

No

result:

ok no solution

Test #4:

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

input:

3

output:

No

result:

ok no solution

Test #5:

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

input:

4

output:

No

result:

ok no solution

Test #6:

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

input:

5

output:

No

result:

ok no solution

Test #7:

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

input:

6

output:

No

result:

ok no solution

Test #8:

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

input:

7

output:

No

result:

ok no solution

Test #9:

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

input:

8

output:

Yes
0 0 500000000 0 410000000 800000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 800000000 500000000 1000...

result:

ok 8 acute triangles

Test #10:

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

input:

9

output:

Yes
0 0 640000000 360000000 0 1000000000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 640000000 200000000
640000000 2...

result:

ok 9 acute triangles

Test #11:

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

input:

10

output:

Yes
0 0 1000000000 0 690000000 500000000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 690000000 500000000
700...

result:

ok 10 acute triangles

Test #12:

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

input:

11

output:

Yes
455000000 400000000 205000000 400000000 250000000 0
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 80000000...

result:

ok 11 acute triangles

Test #13:

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

input:

12

output:

Yes
320000000 680000000 0 500000000 320000000 180000000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 640000000 200000...

result:

ok 12 acute triangles

Test #14:

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

input:

13

output:

Yes
845000000 250000000 345000000 250000000 500000000 0
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 69000000...

result:

ok 13 acute triangles

Test #15:

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

input:

14

output:

Yes
227500000 200000000 352500000 200000000 330000000 400000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 14 acute triangles

Test #16:

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

input:

15

output:

Yes
160000000 340000000 320000000 430000000 160000000 590000000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 15 acute triangles

Test #17:

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

input:

16

output:

Yes
422500000 125000000 672500000 125000000 595000000 250000000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 16 acute triangles

Test #18:

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

input:

17

output:

Yes
341250000 300000000 278750000 300000000 290000000 200000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 17 acute triangles

Test #19:

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

input:

18

output:

Yes
240000000 510000000 160000000 465000000 240000000 385000000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 18 acute triangles

Test #20:

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

input:

19

output:

Yes
633750000 187500000 508750000 187500000 547500000 125000000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 19 acute triangles

Test #21:

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

input:

20

output:

Yes
284375000 250000000 315625000 250000000 310000000 300000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 20 acute triangles

Test #22:

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

input:

21

output:

Yes
200000000 425000000 240000000 447500000 200000000 487500000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 21 acute triangles

Test #23:

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

input:

22

output:

Yes
528125000 156250000 590625000 156250000 571250000 187500000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 22 acute triangles

Test #24:

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

input:

23

output:

Yes
312812500 275000000 297187500 275000000 300000000 250000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 23 acute triangles

Test #25:

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

input:

25

output:

Yes
580937500 171875000 549687500 171875000 559375000 156250000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 25 acute triangles

Test #26:

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

input:

26

output:

Yes
298593750 262500000 306406250 262500000 305000000 275000000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 26 acute triangles

Test #27:

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

input:

27

output:

Yes
210000000 446250000 220000000 451875000 210000000 461875000
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 27 acute triangles

Test #28:

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

input:

28

output:

Yes
554531250 164062500 570156250 164062500 565312500 171875000
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 28 acute triangles

Test #29:

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

input:

29

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
410000000 800000000 500000000 0 590000000 800000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 590000000 ...

result:

ok 29 acute triangles

Test #30:

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

input:

30

output:

Yes
215000000 456875000 210000000 454062500 215000000 449062500
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 30 acute triangles

Test #31:

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

input:

31

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
0 0 690000000 500000000 500000000 690000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 500000000 690000000 ...

result:

ok 31 acute triangles

Test #32:

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

input:

32

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
545000000 400000000 500000000 800000000 455000000 400000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 32 acute triangles

Test #33:

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

input:

33

output:

Yes
212500000 451562500 215000000 452968750 212500000 455468750
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 33 acute triangles

Test #34:

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

input:

34

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
595000000 595000000 250000000 345000000 345000000 250000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 34 acute triangles

Test #35:

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

input:

35

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
477500000 600000000 500000000 400000000 522500000 600000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 35 acute triangles

Test #36:

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

input:

36

output:

Yes
213750000 454218750 212500000 453515625 213750000 452265625
0 1000000000 640000000 360000000 1000000000 1000000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64000000...

result:

ok 36 acute triangles

Test #37:

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

input:

37

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
297500000 297500000 470000000 422500000 422500000 470000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 37 acute triangles

Test #38:

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

input:

38

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
511250000 500000000 500000000 600000000 488750000 500000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 38 acute triangles

Test #39:

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

input:

39

output:

Yes
213750000 454218750 212500000 453515625 213750000 452265625
820000000 680000000 500000000 1000000000 320000000 680000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 64...

result:

ok 39 acute triangles

Test #40:

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

input:

40

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
446250000 446250000 360000000 383750000 383750000 360000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 40 acute triangles

Test #41:

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

input:

41

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
494375000 550000000 500000000 500000000 505625000 550000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 41 acute triangles

Test #42:

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

input:

42

output:

Yes
213750000 454218750 212500000 453515625 213750000 452265625
410000000 840000000 570000000 680000000 660000000 840000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 640...

result:

ok 42 acute triangles

Test #43:

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

input:

43

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
371875000 371875000 415000000 403125000 403125000 415000000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 43 acute triangles

Test #44:

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

input:

44

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
502812500 525000000 500000000 550000000 497187500 525000000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 44 acute triangles

Test #45:

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

input:

45

output:

Yes
213750000 454218750 212500000 453515625 213750000 452265625
615000000 760000000 535000000 840000000 490000000 760000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 640...

result:

ok 45 acute triangles

Test #46:

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

input:

46

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
409062500 409062500 387500000 393437500 393437500 387500000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 46 acute triangles

Test #47:

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

input:

47

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
498593750 537500000 500000000 525000000 501406250 537500000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 47 acute triangles

Test #48:

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

input:

48

output:

Yes
213750000 454218750 212500000 453515625 213750000 452265625
512500000 800000000 552500000 760000000 575000000 800000000
0 0 550000000 0 480000000 270000000
480000000 270000000 550000000 0 640000000 200000000
480000000 270000000 640000000 200000000 640000000 360000000
550000000 0 1000000000 0 640...

result:

ok 48 acute triangles

Test #49:

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

input:

49

output:

Yes
567734375 167968750 559921875 167968750 562343750 164062500
390468750 390468750 401250000 398281250 398281250 401250000
0 0 500000000 690000000 0 1000000000
0 1000000000 500000000 690000000 650000000 1000000000
650000000 1000000000 500000000 690000000 700000000 700000000
700000000 700000000 5000...

result:

ok 49 acute triangles

Test #50:

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

input:

50

output:

Yes
305703125 268750000 301796875 268750000 302500000 262500000
500703125 531250000 500000000 537500000 499296875 531250000
590000000 800000000 500000000 0 1000000000 0
590000000 800000000 1000000000 0 1000000000 1000000000
0 1000000000 410000000 800000000 500000000 1000000000
410000000 800000000 59...

result:

ok 50 acute triangles