QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#576889#8174. Set ConstructionmaspyAC ✓2ms4180kbC++2015.3kb2024-09-19 23:14:202024-09-19 23:14:20

Judging History

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

  • [2024-09-19 23:14:20]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:4180kb
  • [2024-09-19 23:14:20]
  • 提交

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 u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;

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

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

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

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

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

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

#define stoi stoll

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

vi sub(ll M) {
  if (M == 2) return {0, 1};
  if (M % 2 == 1) {
    vi A = sub(M - 1);
    A.eb(MAX(A) * 2 + 1);
    return A;
  }
  vi A = sub(M / 2);
  ll k = MAX(A) + 1;
  FOR(i, M / 2) A.eb(A[i] + k);
  return A;
}

vi gen(ll N, ll M) {
  if (N == 3 && M == 5) { return {0, 4, 5, 6, 7}; }
  if (N == 4 && M == 7) { return {0, 1, 2, 3, 5, 7, 15}; }
  if (N == 5 && M == 15) { return {0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 15, 22, 23, 31}; }
  vi A = sub(M);
  ll now = MAX(A);
  if (now >= (1LL << N)) {
    SHOW(N, M);
    return A;
  }
  assert(now <= (1LL << N) - 1);
  ll add = (1LL << N) - 1 - now;
  for (auto& x: A)
    if (x & 1) x += add;
  return A;
}

void naive(int N, int M) {
  auto dfs = [&](auto& dfs, u64 s, int p) -> void {
    if (p == (1 << N)) return;
    if (popcnt(s) > M) return;
    if (popcnt(s) == M) {
      vc<int> A;
      FOR(i, (1LL << N)) if (s >> i & 1) A.eb(i);
      print(A);
      return;
    }
    dfs(dfs, s, p + 1);
    if (s >> p & 1) return;
    s |= u64(1) << p;
    while (1) {
      bool upd = 0;
      FOR(j, (1 << N)) FOR(i, j) {
        if ((s >> i & 1) && (s >> j & 1)) {
          for (int k: {i & j, i | j}) {
            if (!(s >> k & 1)) {
              if (k < p) return;
              upd = 1;
              s |= u64(1) << k;
            }
          }
        }
      }
      if (!upd) break;
    }
    dfs(dfs, s, p + 1);
  };
  dfs(dfs, 1 | u64(1) << ((1LL << N) - 1), 0);
}

void test() {
  FOR(N, 2, 6) {
    FOR(M, 2, N * (N + 1) / 2 + 1) {
      SHOW(N, M);
      vi A = gen(N, M);
      set<ll> S(all(A));
      assert(len(A) == M);
      assert(len(S) == M);
      assert(S.count(0));
      assert(S.count((1LL << N) - 1));
      assert(MAX(A) == (1LL << N) - 1);
      FOR(j, M) FOR(i, j + 1) {
        assert(S.count(A[i] & A[j]));
        assert(S.count(A[i] | A[j]));
      }
    }
  }
}

void solve() {
  LL(N, M);
  vi A = gen(N, M);
  print(A);
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3808kb

input:

3
3 5
4 8
60 2

output:

0 4 5 6 7
0 9 2 11 4 13 6 15
0 1152921504606846975

result:

ok AC

Test #2:

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

input:

30
6 2
6 3
6 4
6 5
6 6
6 7
6 8
6 9
6 10
6 11
6 12
6 13
6 14
6 15
6 16
6 17
6 18
6 19
6 20
6 21
7 2
7 3
7 4
7 5
7 6
7 7
7 8
7 9
7 10
7 11

output:

0 63
0 61 63
0 61 2 63
0 57 2 59 63
0 57 59 4 61 63
0 49 51 4 53 55 63
0 57 2 59 4 61 6 63
0 49 2 51 4 53 6 55 63
0 49 2 51 55 8 57 10 59 63
0 33 2 35 39 8 41 10 43 47 63
0 49 51 4 53 55 8 57 59 12 61 63
0 33 35 4 37 39 8 41 43 12 45 47 63
0 33 35 4 37 39 47 16 49 51 20 53 55 63
0 1 3 4 5 7 15 16 17...

result:

ok AC

Test #3:

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

input:

30
7 12
7 13
7 14
7 15
7 16
7 17
7 18
7 19
7 20
7 21
7 22
7 23
7 24
7 25
7 26
7 27
7 28
8 2
8 3
8 4
8 5
8 6
8 7
8 8
8 9
8 10
8 11
8 12
8 13
8 14

output:

0 113 115 4 117 119 8 121 123 12 125 127
0 97 99 4 101 103 8 105 107 12 109 111 127
0 97 99 4 101 103 111 16 113 115 20 117 119 127
0 65 67 4 69 71 79 16 81 83 20 85 87 95 127
0 113 2 115 4 117 6 119 8 121 10 123 12 125 14 127
0 97 2 99 4 101 6 103 8 105 10 107 12 109 14 111 127
0 97 2 99 4 101 6 10...

result:

ok AC

Test #4:

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

input:

30
8 15
8 16
8 17
8 18
8 19
8 20
8 21
8 22
8 23
8 24
8 25
8 26
8 27
8 28
8 29
8 30
8 31
8 32
8 33
8 34
8 35
8 36
9 2
9 3
9 4
9 5
9 6
9 7
9 8
9 9

output:

0 193 195 4 197 199 207 16 209 211 20 213 215 223 255
0 241 2 243 4 245 6 247 8 249 10 251 12 253 14 255
0 225 2 227 4 229 6 231 8 233 10 235 12 237 14 239 255
0 225 2 227 4 229 6 231 239 16 241 18 243 20 245 22 247 255
0 193 2 195 4 197 6 199 207 16 209 18 211 20 213 22 215 223 255
0 225 2 227 231 ...

result:

ok AC

Test #5:

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

input:

30
9 10
9 11
9 12
9 13
9 14
9 15
9 16
9 17
9 18
9 19
9 20
9 21
9 22
9 23
9 24
9 25
9 26
9 27
9 28
9 29
9 30
9 31
9 32
9 33
9 34
9 35
9 36
9 37
9 38
9 39

output:

0 497 2 499 503 8 505 10 507 511
0 481 2 483 487 8 489 10 491 495 511
0 497 499 4 501 503 8 505 507 12 509 511
0 481 483 4 485 487 8 489 491 12 493 495 511
0 481 483 4 485 487 495 16 497 499 20 501 503 511
0 449 451 4 453 455 463 16 465 467 20 469 471 479 511
0 497 2 499 4 501 6 503 8 505 10 507 12 ...

result:

ok AC

Test #6:

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

input:

6
9 40
9 41
9 42
9 43
9 44
9 45

output:

0 449 2 451 455 8 457 10 459 463 16 465 18 467 471 24 473 26 475 479 32 481 34 483 487 40 489 42 491 495 48 497 50 499 503 56 505 58 507 511
0 385 2 387 391 8 393 10 395 399 16 401 18 403 407 24 409 26 411 415 32 417 34 419 423 40 425 42 427 431 48 433 50 435 439 56 441 58 443 447 511
0 385 2 387 39...

result:

ok AC

Test #7:

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

input:

30
60 1801
60 1802
60 1803
60 1804
60 1805
60 1806
60 1807
60 1808
60 1809
60 1810
60 1811
60 1812
60 1813
60 1814
60 1815
60 1816
60 1817
60 1818
60 1819
60 1820
60 1821
60 1822
60 1823
60 1824
60 1825
60 1826
60 1827
60 1828
60 1829
60 1830

output:

0 1152921504606830593 1152921504606830595 4 1152921504606830597 1152921504606830599 1152921504606830607 16 1152921504606830609 1152921504606830611 20 1152921504606830613 1152921504606830615 1152921504606830623 32 1152921504606830625 1152921504606830627 36 1152921504606830629 1152921504606830631 1152...

result:

ok AC

Test #8:

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

input:

30
59 1741
59 1742
59 1743
59 1744
59 1745
59 1746
59 1747
59 1748
59 1749
59 1750
59 1751
59 1752
59 1753
59 1754
59 1755
59 1756
59 1757
59 1758
59 1759
59 1760
59 1761
59 1762
59 1763
59 1764
59 1765
59 1766
59 1767
59 1768
59 1769
59 1770

output:

0 576460752303357953 576460752303357955 4 576460752303357957 576460752303357959 8 576460752303357961 576460752303357963 12 576460752303357965 576460752303357967 576460752303357983 32 576460752303357985 576460752303357987 36 576460752303357989 576460752303357991 40 576460752303357993 5764607523033579...

result:

ok AC

Test #9:

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

input:

30
58 1682
58 1683
58 1684
58 1685
58 1686
58 1687
58 1688
58 1689
58 1690
58 1691
58 1692
58 1693
58 1694
58 1695
58 1696
58 1697
58 1698
58 1699
58 1700
58 1701
58 1702
58 1703
58 1704
58 1705
58 1706
58 1707
58 1708
58 1709
58 1710
58 1711

output:

0 288230376151695361 288230376151695363 4 288230376151695365 288230376151695367 8 288230376151695369 288230376151695371 12 288230376151695373 288230376151695375 288230376151695391 32 288230376151695393 288230376151695395 36 288230376151695397 288230376151695399 40 288230376151695401 2882303761516954...

result:

ok AC

Test #10:

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

input:

30
2 2
2 3
3 2
3 3
3 4
3 5
3 6
4 2
4 3
4 4
4 5
4 6
4 7
4 8
4 9
4 10
5 2
5 3
5 4
5 5
5 6
5 7
5 8
5 9
5 10
5 11
5 12
5 13
5 14
5 15

output:

0 3
0 1 3
0 7
0 5 7
0 5 2 7
0 4 5 6 7
0 1 3 4 5 7
0 15
0 13 15
0 13 2 15
0 9 2 11 15
0 9 11 4 13 15
0 1 2 3 5 7 15
0 9 2 11 4 13 6 15
0 1 2 3 4 5 6 7 15
0 1 2 3 7 8 9 10 11 15
0 31
0 29 31
0 29 2 31
0 25 2 27 31
0 25 27 4 29 31
0 17 19 4 21 23 31
0 25 2 27 4 29 6 31
0 17 2 19 4 21 6 23 31
0 17 2 19 ...

result:

ok AC

Test #11:

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

input:

30
2 3
5 4
4 9
5 4
2 2
5 11
2 2
5 15
3 5
2 3
5 15
2 2
5 9
4 7
4 2
3 5
4 6
2 3
2 2
5 13
5 11
5 9
4 5
4 9
4 6
3 3
5 4
3 5
4 3
4 6

output:

0 1 3
0 29 2 31
0 1 2 3 4 5 6 7 15
0 29 2 31
0 3
0 1 2 3 7 8 9 10 11 15 31
0 3
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 4 5 6 7
0 1 3
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 3
0 17 2 19 4 21 6 23 31
0 1 2 3 5 7 15
0 15
0 4 5 6 7
0 9 11 4 13 15
0 1 3
0 3
0 1 3 4 5 7 8 9 11 12 13 15 31
0 1 2 3 7 8 9 10 11 ...

result:

ok AC

Test #12:

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

input:

30
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15

output:

0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 6 7 9 11 13 15 22 23 31
0 1 2 3 4 5 ...

result:

ok AC

Test #13:

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

input:

30
29 242
30 171
41 291
4 7
57 306
30 107
53 75
36 493
47 946
28 376
11 44
31 256
47 672
33 361
55 1258
8 10
13 57
5 15
52 760
17 17
25 145
58 436
49 1087
29 175
57 1015
5 12
42 595
4 6
49 987
54 660

output:

0 536868865 536868867 4 536868869 536868871 536868879 16 536868881 536868883 20 536868885 536868887 536868895 536868927 64 536868929 536868931 68 536868933 536868935 536868943 80 536868945 536868947 84 536868949 536868951 536868959 536868991 128 536868993 536868995 132 536868997 536868999 536869007 ...

result:

ok AC

Test #14:

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

input:

30
48 131
20 28
57 765
59 1532
52 881
56 660
22 19
31 192
47 255
36 487
21 170
18 68
4 9
5 13
8 16
53 1071
19 16
10 2
48 1044
58 933
7 16
60 1410
57 1413
45 213
31 49
26 214
4 3
54 31
59 1075
46 393

output:

0 281474976710145 2 281474976710147 4 281474976710149 6 281474976710151 8 281474976710153 10 281474976710155 12 281474976710157 14 281474976710159 16 281474976710161 18 281474976710163 20 281474976710165 22 281474976710167 24 281474976710169 26 281474976710171 28 281474976710173 30 281474976710175 3...

result:

ok AC

Test #15:

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

input:

30
23 155
51 597
36 137
22 41
32 181
15 13
50 538
51 1239
13 83
22 17
51 896
31 170
10 34
5 13
18 165
13 6
52 340
60 570
60 7
57 494
20 5
13 55
16 15
6 7
22 160
38 427
55 315
56 233
29 48
58 1320

output:

0 8386561 2 8386563 4 8386565 6 8386567 8386575 16 8386577 18 8386579 20 8386581 22 8386583 8386591 8386623 64 8386625 66 8386627 68 8386629 70 8386631 8386639 80 8386641 82 8386643 84 8386645 86 8386647 8386655 8386687 128 8386689 130 8386691 132 8386693 134 8386695 8386703 144 8386705 146 8386707 ...

result:

ok AC

Test #16:

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

input:

30
56 489
21 111
3 3
8 23
41 834
27 145
22 172
52 413
17 57
3 2
35 232
5 11
59 113
33 47
38 475
20 114
16 133
46 265
6 10
18 3
8 28
60 1429
40 373
46 882
4 9
54 1257
20 182
11 54
3 4
22 54

output:

0 72057594037919745 72057594037919747 4 72057594037919749 72057594037919751 72057594037919759 16 72057594037919761 72057594037919763 20 72057594037919765 72057594037919767 72057594037919775 72057594037919807 64 72057594037919809 72057594037919811 68 72057594037919813 72057594037919815 72057594037919...

result:

ok AC

Test #17:

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

input:

30
53 261
40 344
32 159
11 23
41 739
6 14
14 54
20 146
9 22
20 194
44 524
17 13
22 247
48 1142
37 282
33 41
33 205
31 141
31 270
3 6
57 773
60 1036
12 77
22 98
45 994
7 24
23 209
10 33
37 657
57 179

output:

0 9007199254739969 2 9007199254739971 4 9007199254739973 6 9007199254739975 8 9007199254739977 10 9007199254739979 12 9007199254739981 14 9007199254739983 16 9007199254739985 18 9007199254739987 20 9007199254739989 22 9007199254739991 24 9007199254739993 26 9007199254739995 28 9007199254739997 30 90...

result:

ok AC

Test #18:

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

input:

30
36 401
40 314
11 22
18 99
26 313
25 90
41 13
43 388
26 74
45 846
53 1400
24 54
21 160
38 231
54 493
26 270
57 1410
23 242
41 826
5 9
59 370
41 185
56 1344
34 342
49 453
52 118
46 36
35 227
58 324
6 10

output:

0 68719474689 68719474691 4 68719474693 68719474695 8 68719474697 68719474699 12 68719474701 68719474703 16 68719474705 68719474707 20 68719474709 68719474711 24 68719474713 68719474715 28 68719474717 68719474719 68719474751 64 68719474753 68719474755 68 68719474757 68719474759 72 68719474761 687194...

result:

ok AC

Test #19:

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

input:

30
47 781
34 565
24 65
51 211
20 148
24 272
36 382
3 6
59 1251
36 485
30 273
18 118
25 266
31 352
60 144
15 96
56 732
57 1376
20 159
39 397
29 330
14 17
51 1317
57 639
12 38
2 2
38 661
40 578
27 308
18 141

output:

0 140737488347137 140737488347139 4 140737488347141 140737488347143 8 140737488347145 140737488347147 12 140737488347149 140737488347151 16 140737488347153 140737488347155 20 140737488347157 140737488347159 24 140737488347161 140737488347163 28 140737488347165 140737488347167 32 140737488347169 1407...

result:

ok AC

Test #20:

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

input:

30
25 161
34 346
39 713
31 172
27 222
36 650
5 15
52 902
33 453
22 229
21 83
43 338
31 282
56 1472
12 59
44 511
15 3
36 398
48 762
48 943
10 13
43 896
38 159
14 80
11 20
26 28
53 1355
2 3
51 649
24 47

output:

0 33553921 2 33553923 33553927 8 33553929 10 33553931 33553935 16 33553937 18 33553939 33553943 24 33553945 26 33553947 33553951 32 33553953 34 33553955 33553959 40 33553961 42 33553963 33553967 48 33553969 50 33553971 33553975 56 33553977 58 33553979 33553983 64 33553985 66 33553987 33553991 72 335...

result:

ok AC

Test #21:

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

input:

30
53 1388
3 6
3 6
41 29
2 3
34 581
50 790
5 15
6 13
23 188
14 64
47 694
51 69
47 155
16 105
23 70
32 520
8 3
37 488
47 85
41 300
36 487
32 106
36 175
50 117
27 3
13 58
57 786
35 105
3 4

output:

0 9007199254708225 2 9007199254708227 9007199254708231 8 9007199254708233 10 9007199254708235 9007199254708239 16 9007199254708241 18 9007199254708243 9007199254708247 24 9007199254708249 26 9007199254708251 9007199254708255 9007199254708287 64 9007199254708289 66 9007199254708291 9007199254708295 7...

result:

ok AC

Test #22:

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

input:

30
25 321
51 371
19 131
4 2
25 176
28 305
52 538
43 411
43 852
58 817
33 253
36 59
47 207
4 4
60 80
36 3
49 287
57 545
37 191
24 39
57 681
49 641
48 674
38 378
22 68
39 201
29 359
45 330
8 19
59 377

output:

0 33553409 2 33553411 33553415 8 33553417 10 33553419 33553423 16 33553425 18 33553427 33553431 24 33553433 26 33553435 33553439 32 33553441 34 33553443 33553447 40 33553449 42 33553451 33553455 48 33553457 50 33553459 33553463 56 33553465 58 33553467 33553471 64 33553473 66 33553475 33553479 72 335...

result:

ok AC

Test #23:

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

input:

30
20 81
36 479
59 459
24 204
27 231
24 231
39 270
7 15
40 90
21 137
46 603
33 461
39 244
48 556
19 103
9 7
10 33
16 97
8 10
53 985
54 1383
27 375
57 1527
37 336
54 822
3 5
24 261
22 35
9 18
58 103

output:

0 1048321 2 1048323 1048327 8 1048329 10 1048331 1048335 16 1048337 18 1048339 1048343 24 1048345 26 1048347 1048351 32 1048353 34 1048355 1048359 40 1048361 42 1048363 1048367 48 1048369 50 1048371 1048375 56 1048377 58 1048379 1048383 64 1048385 66 1048387 1048391 72 1048393 74 1048395 1048399 80 ...

result:

ok AC

Test #24:

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

input:

30
49 575
44 266
38 706
49 462
5 14
57 1386
42 147
51 941
12 14
2 3
25 295
47 636
20 86
30 4
47 1019
11 56
41 42
55 1428
55 1227
16 13
35 606
49 915
38 703
56 3
31 241
49 352
27 230
14 97
54 1147
39 432

output:

0 562949953388545 2 562949953388547 4 562949953388549 6 562949953388551 8 562949953388553 10 562949953388555 12 562949953388557 14 562949953388559 562949953388575 32 562949953388577 34 562949953388579 36 562949953388581 38 562949953388583 40 562949953388585 42 562949953388587 44 562949953388589 46 5...

result:

ok AC

Test #25:

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

input:

30
45 755
31 23
26 167
22 197
58 527
24 207
8 24
11 33
56 1138
42 94
46 825
33 309
52 2
28 391
33 558
7 24
18 31
51 219
59 1720
42 707
38 239
21 226
60 953
46 132
38 9
34 62
41 50
47 862
19 6
17 69

output:

0 35184372056065 2 35184372056067 35184372056071 8 35184372056073 10 35184372056075 35184372056079 35184372056095 32 35184372056097 34 35184372056099 35184372056103 40 35184372056105 42 35184372056107 35184372056111 35184372056127 35184372056191 128 35184372056193 130 35184372056195 35184372056199 1...

result:

ok AC

Test #26:

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

input:

30
11 60
49 190
48 228
60 60
13 13
36 427
21 159
31 425
34 303
59 101
37 571
33 135
21 111
45 638
60 1399
6 6
45 178
29 241
20 86
50 262
60 241
17 86
25 149
7 5
59 609
43 151
14 48
59 1060
47 140
12 35

output:

0 1793 1795 4 1797 1799 1807 16 1809 1811 20 1813 1815 1823 1855 64 1857 1859 68 1861 1863 1871 80 1873 1875 84 1877 1879 1887 1919 128 1921 1923 132 1925 1927 1935 144 1937 1939 148 1941 1943 1951 1983 192 1985 1987 196 1989 1991 1999 208 2001 2003 212 2005 2007 2015 2047
0 562949953417217 2 562949...

result:

ok AC

Test #27:

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

input:

30
42 456
27 250
9 24
60 1201
31 119
46 460
45 177
8 24
8 10
45 212
28 262
2 2
46 97
35 72
19 149
44 296
16 98
55 626
18 44
34 40
33 293
22 214
27 352
28 347
44 418
4 6
54 1147
28 203
7 5
43 47

output:

0 4398046509057 4398046509059 4 4398046509061 4398046509063 4398046509071 16 4398046509073 4398046509075 20 4398046509077 4398046509079 4398046509087 32 4398046509089 4398046509091 36 4398046509093 4398046509095 4398046509103 48 4398046509105 4398046509107 52 4398046509109 4398046509111 439804650911...

result:

ok AC

Test #28:

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

input:

30
51 1193
51 241
33 525
42 382
50 512
56 346
50 947
43 237
54 1024
49 241
12 25
50 141
33 442
51 987
37 498
24 153
15 110
33 103
34 460
3 4
3 5
34 70
20 79
15 103
47 1112
45 150
48 207
33 181
53 1023
19 4

output:

0 2251799813668865 2 2251799813668867 4 2251799813668869 6 2251799813668871 2251799813668879 16 2251799813668881 18 2251799813668883 20 2251799813668885 22 2251799813668887 2251799813668895 32 2251799813668897 34 2251799813668899 36 2251799813668901 38 2251799813668903 2251799813668911 48 2251799813...

result:

ok AC

Test #29:

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

input:

30
25 222
48 693
57 48
33 555
41 78
11 44
11 44
43 551
50 1262
5 11
30 193
57 1176
48 762
28 315
29 391
47 774
6 12
51 526
54 521
5 4
26 245
20 145
55 759
13 3
58 937
57 1542
17 149
16 95
41 137
36 333

output:

0 33550337 33550339 4 33550341 33550343 8 33550345 33550347 12 33550349 33550351 33550367 32 33550369 33550371 36 33550373 33550375 40 33550377 33550379 44 33550381 33550383 33550399 33550463 128 33550465 33550467 132 33550469 33550471 136 33550473 33550475 140 33550477 33550479 33550495 160 3355049...

result:

ok AC

Test #30:

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

input:

29
50 179
36 37
14 47
15 3
52 734
25 246
33 92
42 327
56 1017
19 84
50 720
13 71
34 141
25 31
29 183
11 40
14 58
28 383
27 45
47 428
19 103
9 40
58 1437
40 222
10 29
59 112
39 510
56 1194
44 875

output:

0 1125899906840577 2 1125899906840579 1125899906840583 8 1125899906840585 10 1125899906840587 1125899906840591 1125899906840607 32 1125899906840609 34 1125899906840611 1125899906840615 40 1125899906840617 42 1125899906840619 1125899906840623 1125899906840639 64 1125899906840641 66 1125899906840643 1...

result:

ok AC

Test #31:

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

input:

29
53 491
27 267
55 1268
7 28
7 25
31 224
22 122
36 338
30 102
4 3
18 112
43 596
45 534
24 255
15 22
26 291
17 70
33 243
47 556
44 117
24 70
35 375
26 232
44 361
46 678
4 2
19 139
46 1056
47 323

output:

0 9007199254724609 9007199254724611 4 9007199254724613 9007199254724615 9007199254724623 16 9007199254724625 9007199254724627 20 9007199254724629 9007199254724631 9007199254724639 9007199254724671 64 9007199254724673 9007199254724675 68 9007199254724677 9007199254724679 9007199254724687 80 900719925...

result:

ok AC

Test #32:

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

input:

29
48 527
20 42
31 377
19 102
38 130
14 63
38 271
54 1151
14 28
46 312
57 326
2 2
7 23
13 56
59 119
37 376
31 217
50 773
49 1204
53 107
13 55
31 251
46 712
51 802
52 799
36 661
38 581
28 100
29 21

output:

0 281474976702465 2 281474976702467 4 281474976702469 6 281474976702471 8 281474976702473 10 281474976702475 12 281474976702477 14 281474976702479 16 281474976702481 18 281474976702483 20 281474976702485 22 281474976702487 24 281474976702489 26 281474976702491 28 281474976702493 30 281474976702495 3...

result:

ok AC

Test #33:

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

input:

30
53 25
49 23
20 23
23 9
32 9
54 15
26 11
35 19
33 7
35 8
34 30
16 17
24 5
35 30
29 5
25 12
12 28
52 27
53 7
21 27
36 16
45 12
55 26
32 7
31 2
19 20
10 14
36 4
46 30
21 23

output:

0 9007199254740929 9007199254740931 4 9007199254740933 9007199254740935 8 9007199254740937 9007199254740939 12 9007199254740941 9007199254740943 16 9007199254740945 9007199254740947 20 9007199254740949 9007199254740951 24 9007199254740953 9007199254740955 28 9007199254740957 9007199254740959 9007199...

result:

ok AC

Test #34:

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

input:

30
44 8
44 31
38 8
15 9
29 16
14 23
24 15
18 7
36 2
21 5
12 4
34 23
28 20
15 23
48 32
51 21
19 5
37 8
10 16
49 5
18 11
49 10
36 21
13 12
59 2
52 13
53 5
60 29
25 15
46 17

output:

0 17592186044409 2 17592186044411 4 17592186044413 6 17592186044415
0 17592186044161 17592186044163 4 17592186044165 17592186044167 17592186044175 16 17592186044177 17592186044179 20 17592186044181 17592186044183 17592186044191 17592186044223 64 17592186044225 17592186044227 68 17592186044229 175921...

result:

ok AC

Test #35:

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

input:

30
54 13
56 27
40 9
47 19
48 3
55 6
34 30
57 21
57 23
41 24
38 27
59 19
31 9
52 15
26 28
28 16
20 32
34 19
28 24
55 15
32 23
50 20
55 27
52 32
40 13
57 28
48 27
37 5
20 2
26 11

output:

0 18014398509481953 18014398509481955 4 18014398509481957 18014398509481959 8 18014398509481961 18014398509481963 12 18014398509481965 18014398509481967 18014398509481983
0 72057594037927809 72057594037927811 4 72057594037927813 72057594037927815 8 72057594037927817 72057594037927819 12 720575940379...

result:

ok AC

Test #36:

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

input:

30
33 26
29 6
39 24
23 11
46 19
19 5
37 27
23 17
42 25
42 16
16 32
41 17
44 31
55 26
26 2
14 2
58 9
43 15
56 16
14 17
41 11
38 16
20 16
27 18
44 2
45 3
15 21
24 29
40 23
17 25

output:

0 8589934529 8589934531 4 8589934533 8589934535 8 8589934537 8589934539 12 8589934541 8589934543 8589934559 32 8589934561 8589934563 36 8589934565 8589934567 40 8589934569 8589934571 44 8589934573 8589934575 8589934591
0 536870905 536870907 4 536870909 536870911
0 549755813857 549755813859 4 5497558...

result:

ok AC

Test #37:

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

input:

30
30 26
25 8
40 11
55 15
44 6
18 29
33 6
11 21
45 5
25 8
55 29
42 23
34 2
47 7
21 13
25 31
58 20
37 31
51 14
38 30
14 22
15 5
28 21
60 9
47 7
16 32
50 7
56 18
23 14
10 27

output:

0 1073741761 1073741763 4 1073741765 1073741767 8 1073741769 1073741771 12 1073741773 1073741775 1073741791 32 1073741793 1073741795 36 1073741797 1073741799 40 1073741801 1073741803 44 1073741805 1073741807 1073741823
0 33554425 2 33554427 4 33554429 6 33554431
0 1099511627745 2 1099511627747 10995...

result:

ok AC

Test #38:

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

input:

30
10 23
26 32
42 23
18 10
51 8
38 13
53 31
58 20
56 30
54 17
37 25
36 6
26 20
60 13
27 7
44 32
60 11
55 17
46 18
50 17
57 28
28 8
30 10
18 31
45 28
34 26
56 29
30 29
60 13
42 23

output:

0 897 2 899 903 8 905 10 907 911 927 32 929 34 931 935 40 937 42 939 943 959 1023
0 67108833 2 67108835 4 67108837 6 67108839 8 67108841 10 67108843 12 67108845 14 67108847 16 67108849 18 67108851 20 67108853 22 67108855 24 67108857 26 67108859 28 67108861 30 67108863
0 4398046510977 2 4398046510979...

result:

ok AC

Test #39:

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

input:

30
22 253
55 1512
44 980
25 318
60 1814
24 287
55 1535
16 124
53 1423
36 661
44 975
25 313
22 240
54 1475
33 556
37 697
48 1147
60 1805
42 883
48 1154
45 1020
50 1272
27 378
51 1320
47 1122
50 1263
23 254
57 1624
32 514
38 724

output:

0 4186113 4186115 4 4186117 4186119 4186127 16 4186129 4186131 20 4186133 4186135 4186143 4186175 64 4186177 4186179 68 4186181 4186183 4186191 80 4186193 4186195 84 4186197 4186199 4186207 4186239 4186367 256 4186369 4186371 260 4186373 4186375 4186383 272 4186385 4186387 276 4186389 4186391 418639...

result:

ok AC

Test #40:

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

input:

30
42 897
30 463
22 226
57 1647
38 735
59 1751
16 113
17 152
18 146
22 241
26 322
10 43
39 758
11 44
14 98
34 570
46 1057
26 338
19 163
58 1684
34 586
28 385
57 1645
11 36
56 1573
27 370
48 1160
32 498
24 295
28 402

output:

0 4398046507009 4398046507011 4 4398046507013 4398046507015 4398046507023 16 4398046507025 4398046507027 20 4398046507029 4398046507031 4398046507039 32 4398046507041 4398046507043 36 4398046507045 4398046507047 4398046507055 48 4398046507057 4398046507059 52 4398046507061 4398046507063 439804650707...

result:

ok AC

Test #41:

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

input:

30
41 834
57 1653
55 1512
29 413
12 66
54 1459
34 569
50 1249
34 590
21 203
58 1681
35 609
47 1118
11 59
10 29
50 1270
10 31
26 322
42 899
46 1059
18 171
35 613
27 363
33 541
55 1525
31 469
47 1098
42 879
46 1065
23 275

output:

0 2199023251457 2199023251459 4 2199023251461 2199023251463 8 2199023251465 2199023251467 12 2199023251469 2199023251471 2199023251487 32 2199023251489 2199023251491 36 2199023251493 2199023251495 40 2199023251497 2199023251499 44 2199023251501 2199023251503 2199023251519 64 2199023251521 2199023251...

result:

ok AC

Test #42:

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

input:

30
16 123
23 269
53 1421
42 887
60 1808
31 480
33 538
49 1225
35 609
59 1744
48 1150
52 1350
35 612
44 987
17 144
15 94
16 123
21 216
23 268
57 1633
23 273
28 406
54 1455
32 507
28 380
11 51
14 98
32 526
45 1022
53 1404

output:

0 63489 63491 4 63493 63495 63503 16 63505 63507 20 63509 63511 63519 63551 64 63553 63555 68 63557 63559 63567 80 63569 63571 84 63573 63575 63583 63615 128 63617 63619 132 63621 63623 63631 144 63633 63635 148 63637 63639 63647 63679 192 63681 63683 196 63685 63687 63695 208 63697 63699 212 63701 ...

result:

ok AC

Test #43:

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

input:

30
28 393
40 819
56 1571
11 37
41 849
27 375
20 202
53 1430
56 1584
32 510
43 937
25 300
22 225
55 1529
11 42
18 151
17 126
36 662
13 91
60 1813
28 383
53 1418
60 1826
25 297
33 536
58 1683
14 102
47 1101
32 509
32 516

output:

0 268433409 268433411 4 268433413 268433415 8 268433417 268433419 12 268433421 268433423 16 268433425 268433427 20 268433429 268433431 24 268433433 268433435 28 268433437 268433439 32 268433441 268433443 36 268433445 268433447 40 268433449 268433451 44 268433453 268433455 48 268433457 268433459 52 2...

result:

ok AC

Test #44:

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

input:

30
35 626
11 60
46 1053
47 1098
38 727
54 1455
27 363
40 814
29 412
19 169
49 1216
34 578
10 29
22 240
51 1312
57 1642
44 966
36 655
27 368
35 617
59 1747
53 1423
26 325
49 1209
34 574
11 45
53 1414
57 1645
35 606
40 814

output:

0 34359730177 2 34359730179 4 34359730181 6 34359730183 34359730191 16 34359730193 18 34359730195 20 34359730197 22 34359730199 34359730207 34359730239 64 34359730241 66 34359730243 68 34359730245 70 34359730247 34359730255 80 34359730257 82 34359730259 84 34359730261 86 34359730263 34359730271 3435...

result:

ok AC

Test #45:

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

input:

30
60 1102
60 403
58 82
58 65
59 428
58 1173
58 626
58 1153
58 1448
59 1581
58 929
60 1019
58 530
60 1629
60 1546
60 824
59 3
58 1399
59 1165
60 417
59 1260
59 1310
58 1164
60 384
59 1325
58 131
60 1559
59 224
59 1489
60 1129

output:

0 1152921504606830593 2 1152921504606830595 4 1152921504606830597 6 1152921504606830599 8 1152921504606830601 10 1152921504606830603 12 1152921504606830605 14 1152921504606830607 1152921504606830623 32 1152921504606830625 34 1152921504606830627 36 1152921504606830629 38 1152921504606830631 40 115292...

result:

ok AC

Test #46:

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

input:

30
60 452
60 169
59 682
60 1006
60 1426
60 585
59 1368
60 1572
60 761
59 1113
59 1271
59 793
60 890
58 620
60 1774
58 285
60 1525
59 1277
58 861
60 515
60 1529
58 523
58 1129
59 917
60 1459
60 491
60 872
58 624
58 711
59 953

output:

0 1152921504606844929 1152921504606844931 4 1152921504606844933 1152921504606844935 1152921504606844943 16 1152921504606844945 1152921504606844947 20 1152921504606844949 1152921504606844951 1152921504606844959 32 1152921504606844961 1152921504606844963 36 1152921504606844965 1152921504606844967 1152...

result:

ok AC

Test #47:

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

input:

30
58 1370
59 14
60 79
59 1121
59 347
59 843
60 110
60 301
58 480
58 597
59 648
59 482
58 1169
60 340
58 681
59 1725
60 568
60 719
60 1327
59 577
60 380
58 882
58 934
58 1238
58 347
59 1007
59 143
60 1021
59 567
59 1572

output:

0 288230376151678977 2 288230376151678979 288230376151678983 8 288230376151678985 10 288230376151678987 288230376151678991 16 288230376151678993 18 288230376151678995 288230376151678999 24 288230376151679001 26 288230376151679003 288230376151679007 288230376151679039 64 288230376151679041 66 2882303...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed