QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#324224 | #8231. Festival Decorating | ucup-team159# | AC ✓ | 6875ms | 19308kb | C++20 | 48.5kb | 2024-02-10 17:05:38 | 2024-10-20 19:56:32 |
Judging History
answer
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
//#pragma GCC optimize("Ofast")
//#undef LOCAL
#include <unistd.h>
#include <algorithm>
#include <array>
#include <cassert>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include <bit>
#include <cstdint>
#include <cassert>
#include <numeric>
#include <type_traits>
namespace yosupo {
namespace internal {
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value ||
std::is_same<T, __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int128 =
typename std::conditional<std::is_same<T, __uint128_t>::value ||
std::is_same<T, unsigned __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using make_unsigned_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value,
__uint128_t,
unsigned __int128>;
template <class T>
using is_integral =
typename std::conditional<std::is_integral<T>::value ||
internal::is_signed_int128<T>::value ||
internal::is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_signed_int = typename std::conditional<(is_integral<T>::value &&
std::is_signed<T>::value) ||
is_signed_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int =
typename std::conditional<(is_integral<T>::value &&
std::is_unsigned<T>::value) ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using to_unsigned = typename std::conditional<
is_signed_int128<T>::value,
make_unsigned_int128<T>,
typename std::conditional<std::is_signed<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type>::type;
template <class T>
using is_integral_t = std::enable_if_t<is_integral<T>::value>;
template <class T>
using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;
template <class T>
using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;
template <class T> using to_unsigned_t = typename to_unsigned<T>::type;
} // namespace internal
} // namespace yosupo
namespace yosupo {
struct Scanner {
public:
Scanner(const Scanner&) = delete;
Scanner& operator=(const Scanner&) = delete;
Scanner(FILE* fp) : fd(fileno(fp)) { line[0] = 127; }
void read() {}
template <class H, class... T> void read(H& h, T&... t) {
bool f = read_single(h);
assert(f);
read(t...);
}
int read_unsafe() { return 0; }
template <class H, class... T> int read_unsafe(H& h, T&... t) {
bool f = read_single(h);
if (!f) return 0;
return 1 + read_unsafe(t...);
}
int close() { return ::close(fd); }
private:
static constexpr int SIZE = 1 << 15;
int fd = -1;
std::array<char, SIZE + 1> line;
int st = 0, ed = 0;
bool eof = false;
bool read_single(std::string& ref) {
if (!skip_space()) return false;
ref = "";
while (true) {
char c = top();
if (c <= ' ') break;
ref += c;
st++;
}
return true;
}
bool read_single(double& ref) {
std::string s;
if (!read_single(s)) return false;
ref = std::stod(s);
return true;
}
template <class T,
std::enable_if_t<std::is_same<T, char>::value>* = nullptr>
bool read_single(T& ref) {
if (!skip_space<50>()) return false;
ref = top();
st++;
return true;
}
template <class T,
internal::is_signed_int_t<T>* = nullptr,
std::enable_if_t<!std::is_same<T, char>::value>* = nullptr>
bool read_single(T& sref) {
using U = internal::to_unsigned_t<T>;
if (!skip_space<50>()) return false;
bool neg = false;
if (line[st] == '-') {
neg = true;
st++;
}
U ref = 0;
do {
ref = 10 * ref + (line[st++] & 0x0f);
} while (line[st] >= '0');
sref = neg ? -ref : ref;
return true;
}
template <class U,
internal::is_unsigned_int_t<U>* = nullptr,
std::enable_if_t<!std::is_same<U, char>::value>* = nullptr>
bool read_single(U& ref) {
if (!skip_space<50>()) return false;
ref = 0;
do {
ref = 10 * ref + (line[st++] & 0x0f);
} while (line[st] >= '0');
return true;
}
bool reread() {
if (ed - st >= 50) return true;
if (st > SIZE / 2) {
std::memmove(line.data(), line.data() + st, ed - st);
ed -= st;
st = 0;
}
if (eof) return false;
auto u = ::read(fd, line.data() + ed, SIZE - ed);
if (u == 0) {
eof = true;
line[ed] = '\0';
u = 1;
}
ed += int(u);
line[ed] = char(127);
return true;
}
char top() {
if (st == ed) {
bool f = reread();
assert(f);
}
return line[st];
}
template <int TOKEN_LEN = 0> bool skip_space() {
while (true) {
while (line[st] <= ' ') st++;
if (ed - st > TOKEN_LEN) return true;
if (st > ed) st = ed;
for (auto i = st; i < ed; i++) {
if (line[i] <= ' ') return true;
}
if (!reread()) return false;
}
}
};
struct Printer {
public:
template <char sep = ' ', bool F = false> void write() {}
template <char sep = ' ', bool F = false, class H, class... T>
void write(const H& h, const T&... t) {
if (F) write_single(sep);
write_single(h);
write<true>(t...);
}
template <char sep = ' ', class... T> void writeln(const T&... t) {
write<sep>(t...);
write_single('\n');
}
Printer(FILE* _fp) : fd(fileno(_fp)) {}
~Printer() { flush(); }
int close() {
flush();
return ::close(fd);
}
void flush() {
if (pos) {
auto res = ::write(fd, line.data(), pos);
assert(res != -1);
pos = 0;
}
}
private:
static std::array<std::array<char, 2>, 100> small;
static std::array<unsigned long long, 20> tens;
static constexpr size_t SIZE = 1 << 15;
int fd;
std::array<char, SIZE> line;
size_t pos = 0;
std::stringstream ss;
template <class T,
std::enable_if_t<std::is_same<char, T>::value>* = nullptr>
void write_single(const T& val) {
if (pos == SIZE) flush();
line[pos++] = val;
}
template <class T,
internal::is_signed_int_t<T>* = nullptr,
std::enable_if_t<!std::is_same<char, T>::value>* = nullptr>
void write_single(const T& val) {
using U = internal::to_unsigned_t<T>;
if (val == 0) {
write_single('0');
return;
}
if (pos > SIZE - 50) flush();
U uval = val;
if (val < 0) {
write_single('-');
uval = -uval;
}
write_unsigned(uval);
}
template <class U, internal::is_unsigned_int_t<U>* = nullptr>
void write_single(U uval) {
if (uval == 0) {
write_single('0');
return;
}
if (pos > SIZE - 50) flush();
write_unsigned(uval);
}
static int calc_len(uint64_t x) {
int i = ((63 - std::countl_zero(x)) * 3 + 3) / 10;
if (x < tens[i])
return i;
else
return i + 1;
}
template <class U,
internal::is_unsigned_int_t<U>* = nullptr,
std::enable_if_t<2 >= sizeof(U)>* = nullptr>
void write_unsigned(U uval) {
size_t len = calc_len(uval);
pos += len;
char* ptr = line.data() + pos;
while (uval >= 100) {
ptr -= 2;
memcpy(ptr, small[uval % 100].data(), 2);
uval /= 100;
}
if (uval >= 10) {
memcpy(ptr - 2, small[uval].data(), 2);
} else {
*(ptr - 1) = char('0' + uval);
}
}
template <class U,
internal::is_unsigned_int_t<U>* = nullptr,
std::enable_if_t<4 == sizeof(U)>* = nullptr>
void write_unsigned(U uval) {
std::array<char, 8> buf;
memcpy(buf.data() + 6, small[uval % 100].data(), 2);
memcpy(buf.data() + 4, small[uval / 100 % 100].data(), 2);
memcpy(buf.data() + 2, small[uval / 10000 % 100].data(), 2);
memcpy(buf.data() + 0, small[uval / 1000000 % 100].data(), 2);
if (uval >= 100000000) {
if (uval >= 1000000000) {
memcpy(line.data() + pos, small[uval / 100000000 % 100].data(),
2);
pos += 2;
} else {
line[pos] = char('0' + uval / 100000000);
pos++;
}
memcpy(line.data() + pos, buf.data(), 8);
pos += 8;
} else {
size_t len = calc_len(uval);
memcpy(line.data() + pos, buf.data() + (8 - len), len);
pos += len;
}
}
template <class U,
internal::is_unsigned_int_t<U>* = nullptr,
std::enable_if_t<8 == sizeof(U)>* = nullptr>
void write_unsigned(U uval) {
size_t len = calc_len(uval);
pos += len;
char* ptr = line.data() + pos;
while (uval >= 100) {
ptr -= 2;
memcpy(ptr, small[uval % 100].data(), 2);
uval /= 100;
}
if (uval >= 10) {
memcpy(ptr - 2, small[uval].data(), 2);
} else {
*(ptr - 1) = char('0' + uval);
}
}
template <
class U,
std::enable_if_t<internal::is_unsigned_int128<U>::value>* = nullptr>
void write_unsigned(U uval) {
static std::array<char, 50> buf;
size_t len = 0;
while (uval > 0) {
buf[len++] = char((uval % 10) + '0');
uval /= 10;
}
std::reverse(buf.begin(), buf.begin() + len);
memcpy(line.data() + pos, buf.data(), len);
pos += len;
}
void write_single(const std::string& s) {
for (char c : s) write_single(c);
}
void write_single(const char* s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) write_single(s[i]);
}
template <class T> void write_single(const std::vector<T>& val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write_single(' ');
write_single(val[i]);
}
}
};
std::array<std::array<char, 2>, 100> Printer::small = [] {
std::array<std::array<char, 2>, 100> table;
for (int i = 0; i <= 99; i++) {
table[i][1] = char('0' + (i % 10));
table[i][0] = char('0' + (i / 10 % 10));
}
return table;
}();
std::array<unsigned long long, 20> Printer::tens = [] {
std::array<unsigned long long, 20> table;
for (int i = 0; i < 20; i++) {
table[i] = 1;
for (int j = 0; j < i; j++) {
table[i] *= 10;
}
}
return table;
}();
} // namespace yosupo
#include <cassert>
#include <numeric>
#include <type_traits>
#ifdef _MSC_VER
#include <intrin.h>
#endif
#include <utility>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace atcoder {
namespace internal {
constexpr long long safe_mod(long long x, long long m) {
x %= m;
if (x < 0) x += m;
return x;
}
struct barrett {
unsigned int _m;
unsigned long long im;
explicit barrett(unsigned int m) : _m(m), im((unsigned long long)(-1) / m + 1) {}
unsigned int umod() const { return _m; }
unsigned int mul(unsigned int a, unsigned int b) const {
unsigned long long z = a;
z *= b;
#ifdef _MSC_VER
unsigned long long x;
_umul128(z, im, &x);
#else
unsigned long long x =
(unsigned long long)(((unsigned __int128)(z)*im) >> 64);
#endif
unsigned long long y = x * _m;
return (unsigned int)(z - y + (z < y ? _m : 0));
}
};
constexpr long long pow_mod_constexpr(long long x, long long n, int m) {
if (m == 1) return 0;
unsigned int _m = (unsigned int)(m);
unsigned long long r = 1;
unsigned long long y = safe_mod(x, m);
while (n) {
if (n & 1) r = (r * y) % _m;
y = (y * y) % _m;
n >>= 1;
}
return r;
}
constexpr bool is_prime_constexpr(int n) {
if (n <= 1) return false;
if (n == 2 || n == 7 || n == 61) return true;
if (n % 2 == 0) return false;
long long d = n - 1;
while (d % 2 == 0) d /= 2;
constexpr long long bases[3] = {2, 7, 61};
for (long long a : bases) {
long long t = d;
long long y = pow_mod_constexpr(a, t, n);
while (t != n - 1 && y != 1 && y != n - 1) {
y = y * y % n;
t <<= 1;
}
if (y != n - 1 && t % 2 == 0) {
return false;
}
}
return true;
}
template <int n> constexpr bool is_prime = is_prime_constexpr(n);
constexpr std::pair<long long, long long> inv_gcd(long long a, long long b) {
a = safe_mod(a, b);
if (a == 0) return {b, 0};
long long s = b, t = a;
long long m0 = 0, m1 = 1;
while (t) {
long long u = s / t;
s -= t * u;
m0 -= m1 * u; // |m1 * u| <= |m1| * s <= b
auto tmp = s;
s = t;
t = tmp;
tmp = m0;
m0 = m1;
m1 = tmp;
}
if (m0 < 0) m0 += b / s;
return {s, m0};
}
constexpr int primitive_root_constexpr(int m) {
if (m == 2) return 1;
if (m == 167772161) return 3;
if (m == 469762049) return 3;
if (m == 754974721) return 11;
if (m == 998244353) return 3;
int divs[20] = {};
divs[0] = 2;
int cnt = 1;
int x = (m - 1) / 2;
while (x % 2 == 0) x /= 2;
for (int i = 3; (long long)(i)*i <= x; i += 2) {
if (x % i == 0) {
divs[cnt++] = i;
while (x % i == 0) {
x /= i;
}
}
}
if (x > 1) {
divs[cnt++] = x;
}
for (int g = 2;; g++) {
bool ok = true;
for (int i = 0; i < cnt; i++) {
if (pow_mod_constexpr(g, (m - 1) / divs[i], m) == 1) {
ok = false;
break;
}
}
if (ok) return g;
}
}
template <int m> constexpr int primitive_root = primitive_root_constexpr(m);
unsigned long long floor_sum_unsigned(unsigned long long n,
unsigned long long m,
unsigned long long a,
unsigned long long b) {
unsigned long long ans = 0;
while (true) {
if (a >= m) {
ans += n * (n - 1) / 2 * (a / m);
a %= m;
}
if (b >= m) {
ans += n * (b / m);
b %= m;
}
unsigned long long y_max = a * n + b;
if (y_max < m) break;
n = (unsigned long long)(y_max / m);
b = (unsigned long long)(y_max % m);
std::swap(m, a);
}
return ans;
}
} // namespace internal
} // namespace atcoder
#include <cassert>
#include <numeric>
#include <type_traits>
namespace atcoder {
namespace internal {
#ifndef _MSC_VER
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value ||
std::is_same<T, __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int128 =
typename std::conditional<std::is_same<T, __uint128_t>::value ||
std::is_same<T, unsigned __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using make_unsigned_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value,
__uint128_t,
unsigned __int128>;
template <class T>
using is_integral = typename std::conditional<std::is_integral<T>::value ||
is_signed_int128<T>::value ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_signed_int = typename std::conditional<(is_integral<T>::value &&
std::is_signed<T>::value) ||
is_signed_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int =
typename std::conditional<(is_integral<T>::value &&
std::is_unsigned<T>::value) ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using to_unsigned = typename std::conditional<
is_signed_int128<T>::value,
make_unsigned_int128<T>,
typename std::conditional<std::is_signed<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type>::type;
#else
template <class T> using is_integral = typename std::is_integral<T>;
template <class T>
using is_signed_int =
typename std::conditional<is_integral<T>::value && std::is_signed<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int =
typename std::conditional<is_integral<T>::value &&
std::is_unsigned<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using to_unsigned = typename std::conditional<is_signed_int<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type;
#endif
template <class T>
using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;
template <class T>
using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;
template <class T> using to_unsigned_t = typename to_unsigned<T>::type;
} // namespace internal
} // namespace atcoder
namespace atcoder {
namespace internal {
struct modint_base {};
struct static_modint_base : modint_base {};
template <class T> using is_modint = std::is_base_of<modint_base, T>;
template <class T> using is_modint_t = std::enable_if_t<is_modint<T>::value>;
} // namespace internal
template <int m, std::enable_if_t<(1 <= m)>* = nullptr>
struct static_modint : internal::static_modint_base {
using mint = static_modint;
public:
static constexpr int mod() { return m; }
static mint raw(int v) {
mint x;
x._v = v;
return x;
}
static_modint() : _v(0) {}
template <class T, internal::is_signed_int_t<T>* = nullptr>
static_modint(T v) {
long long x = (long long)(v % (long long)(umod()));
if (x < 0) x += umod();
_v = (unsigned int)(x);
}
template <class T, internal::is_unsigned_int_t<T>* = nullptr>
static_modint(T v) {
_v = (unsigned int)(v % umod());
}
unsigned int val() const { return _v; }
mint& operator++() {
_v++;
if (_v == umod()) _v = 0;
return *this;
}
mint& operator--() {
if (_v == 0) _v = umod();
_v--;
return *this;
}
mint operator++(int) {
mint result = *this;
++*this;
return result;
}
mint operator--(int) {
mint result = *this;
--*this;
return result;
}
mint& operator+=(const mint& rhs) {
_v += rhs._v;
if (_v >= umod()) _v -= umod();
return *this;
}
mint& operator-=(const mint& rhs) {
_v -= rhs._v;
if (_v >= umod()) _v += umod();
return *this;
}
mint& operator*=(const mint& rhs) {
unsigned long long z = _v;
z *= rhs._v;
_v = (unsigned int)(z % umod());
return *this;
}
mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
mint operator+() const { return *this; }
mint operator-() const { return mint() - *this; }
mint pow(long long n) const {
assert(0 <= n);
mint x = *this, r = 1;
while (n) {
if (n & 1) r *= x;
x *= x;
n >>= 1;
}
return r;
}
mint inv() const {
if (prime) {
assert(_v);
return pow(umod() - 2);
} else {
auto eg = internal::inv_gcd(_v, m);
assert(eg.first == 1);
return eg.second;
}
}
friend mint operator+(const mint& lhs, const mint& rhs) {
return mint(lhs) += rhs;
}
friend mint operator-(const mint& lhs, const mint& rhs) {
return mint(lhs) -= rhs;
}
friend mint operator*(const mint& lhs, const mint& rhs) {
return mint(lhs) *= rhs;
}
friend mint operator/(const mint& lhs, const mint& rhs) {
return mint(lhs) /= rhs;
}
friend bool operator==(const mint& lhs, const mint& rhs) {
return lhs._v == rhs._v;
}
friend bool operator!=(const mint& lhs, const mint& rhs) {
return lhs._v != rhs._v;
}
private:
unsigned int _v;
static constexpr unsigned int umod() { return m; }
static constexpr bool prime = internal::is_prime<m>;
};
template <int id> struct dynamic_modint : internal::modint_base {
using mint = dynamic_modint;
public:
static int mod() { return (int)(bt.umod()); }
static void set_mod(int m) {
assert(1 <= m);
bt = internal::barrett(m);
}
static mint raw(int v) {
mint x;
x._v = v;
return x;
}
dynamic_modint() : _v(0) {}
template <class T, internal::is_signed_int_t<T>* = nullptr>
dynamic_modint(T v) {
long long x = (long long)(v % (long long)(mod()));
if (x < 0) x += mod();
_v = (unsigned int)(x);
}
template <class T, internal::is_unsigned_int_t<T>* = nullptr>
dynamic_modint(T v) {
_v = (unsigned int)(v % mod());
}
unsigned int val() const { return _v; }
mint& operator++() {
_v++;
if (_v == umod()) _v = 0;
return *this;
}
mint& operator--() {
if (_v == 0) _v = umod();
_v--;
return *this;
}
mint operator++(int) {
mint result = *this;
++*this;
return result;
}
mint operator--(int) {
mint result = *this;
--*this;
return result;
}
mint& operator+=(const mint& rhs) {
_v += rhs._v;
if (_v >= umod()) _v -= umod();
return *this;
}
mint& operator-=(const mint& rhs) {
_v += mod() - rhs._v;
if (_v >= umod()) _v -= umod();
return *this;
}
mint& operator*=(const mint& rhs) {
_v = bt.mul(_v, rhs._v);
return *this;
}
mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
mint operator+() const { return *this; }
mint operator-() const { return mint() - *this; }
mint pow(long long n) const {
assert(0 <= n);
mint x = *this, r = 1;
while (n) {
if (n & 1) r *= x;
x *= x;
n >>= 1;
}
return r;
}
mint inv() const {
auto eg = internal::inv_gcd(_v, mod());
assert(eg.first == 1);
return eg.second;
}
friend mint operator+(const mint& lhs, const mint& rhs) {
return mint(lhs) += rhs;
}
friend mint operator-(const mint& lhs, const mint& rhs) {
return mint(lhs) -= rhs;
}
friend mint operator*(const mint& lhs, const mint& rhs) {
return mint(lhs) *= rhs;
}
friend mint operator/(const mint& lhs, const mint& rhs) {
return mint(lhs) /= rhs;
}
friend bool operator==(const mint& lhs, const mint& rhs) {
return lhs._v == rhs._v;
}
friend bool operator!=(const mint& lhs, const mint& rhs) {
return lhs._v != rhs._v;
}
private:
unsigned int _v;
static internal::barrett bt;
static unsigned int umod() { return bt.umod(); }
};
template <int id> internal::barrett dynamic_modint<id>::bt(998244353);
using modint998244353 = static_modint<998244353>;
using modint1000000007 = static_modint<1000000007>;
using modint = dynamic_modint<-1>;
namespace internal {
template <class T>
using is_static_modint = std::is_base_of<internal::static_modint_base, T>;
template <class T>
using is_static_modint_t = std::enable_if_t<is_static_modint<T>::value>;
template <class> struct is_dynamic_modint : public std::false_type {};
template <int id>
struct is_dynamic_modint<dynamic_modint<id>> : public std::true_type {};
template <class T>
using is_dynamic_modint_t = std::enable_if_t<is_dynamic_modint<T>::value>;
} // namespace internal
} // namespace atcoder
#include <iostream>
namespace atcoder {
template <int MOD>
std::ostream& operator<<(std::ostream& os, const static_modint<MOD>& x) {
return os << x.val();
}
template <int ID>
std::ostream& operator<<(std::ostream& os, const dynamic_modint<ID>& x) {
return os << x.val();
}
} // namespace atcoder
namespace yosupo {
template <int MOD> using static_modint = atcoder::static_modint<MOD>;
template <int ID> using dynamic_modint = atcoder::dynamic_modint<ID>;
using modint998244353 = atcoder::modint998244353;
using modint1000000007 = atcoder::modint1000000007;
using modint = atcoder::modint;
struct modint61 {
using mint = modint61;
public:
static constexpr long long mod() { return (1ULL << 61) - 1; }
static mint raw(long long v) {
mint x;
x._v = v;
return x;
}
modint61() : _v(0) {}
template <class T, atcoder::internal::is_signed_int_t<T>* = nullptr>
modint61(T v) {
long long x = (long long)(v % (long long)(umod()));
if (x < 0) x += umod();
_v = (unsigned long long)(x);
}
template <class T, atcoder::internal::is_unsigned_int_t<T>* = nullptr>
modint61(T v) {
_v = (unsigned long long)(v % umod());
}
unsigned long long val() const { return _v; }
mint& operator++() {
_v++;
if (_v == umod()) _v = 0;
return *this;
}
mint& operator--() {
if (_v == 0) _v = umod();
_v--;
return *this;
}
mint operator++(int) {
mint result = *this;
++*this;
return result;
}
mint operator--(int) {
mint result = *this;
--*this;
return result;
}
mint& operator+=(const mint& rhs) {
_v += rhs._v;
if (_v >= umod()) _v -= umod();
return *this;
}
mint& operator-=(const mint& rhs) {
_v -= rhs._v;
if (_v >= umod()) _v += umod();
return *this;
}
mint& operator*=(const mint& rhs) {
__uint128_t t = (__uint128_t) _v * rhs._v;
_v = (unsigned long long)((t >> 61) + (t & umod()));
_v = (_v >= umod()) ? _v - umod() : _v;
return *this;
}
mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
mint operator+() const { return *this; }
mint operator-() const { return mint() - *this; }
mint pow(long long n) const {
assert(0 <= n);
mint x = *this, r = 1;
while (n) {
if (n & 1) r *= x;
x *= x;
n >>= 1;
}
return r;
}
mint inv() const {
assert(_v);
return pow(umod() - 2);
}
friend mint operator+(const mint& lhs, const mint& rhs) {
return mint(lhs) += rhs;
}
friend mint operator-(const mint& lhs, const mint& rhs) {
return mint(lhs) -= rhs;
}
friend mint operator*(const mint& lhs, const mint& rhs) {
return mint(lhs) *= rhs;
}
friend mint operator/(const mint& lhs, const mint& rhs) {
return mint(lhs) /= rhs;
}
friend bool operator==(const mint& lhs, const mint& rhs) {
return lhs._v == rhs._v;
}
friend bool operator!=(const mint& lhs, const mint& rhs) {
return lhs._v != rhs._v;
}
private:
unsigned long long _v;
static constexpr unsigned long long umod() { return mod(); }
};
} // namespace yosupo
#include <algorithm>
#include <array>
#include <cassert>
#include <type_traits>
#include <vector>
#ifdef _MSC_VER
#include <intrin.h>
#endif
#if __cplusplus >= 202002L
#include <bit>
#endif
namespace atcoder {
namespace internal {
#if __cplusplus >= 202002L
using std::bit_ceil;
#else
unsigned int bit_ceil(unsigned int n) {
unsigned int x = 1;
while (x < (unsigned int)(n)) x *= 2;
return x;
}
#endif
int countr_zero(unsigned int n) {
#ifdef _MSC_VER
unsigned long index;
_BitScanForward(&index, n);
return index;
#else
return __builtin_ctz(n);
#endif
}
constexpr int countr_zero_constexpr(unsigned int n) {
int x = 0;
while (!(n & (1 << x))) x++;
return x;
}
} // namespace internal
} // namespace atcoder
namespace atcoder {
namespace internal {
template <class mint,
int g = internal::primitive_root<mint::mod()>,
internal::is_static_modint_t<mint>* = nullptr>
struct fft_info {
static constexpr int rank2 = countr_zero_constexpr(mint::mod() - 1);
std::array<mint, rank2 + 1> root; // root[i]^(2^i) == 1
std::array<mint, rank2 + 1> iroot; // root[i] * iroot[i] == 1
std::array<mint, std::max(0, rank2 - 2 + 1)> rate2;
std::array<mint, std::max(0, rank2 - 2 + 1)> irate2;
std::array<mint, std::max(0, rank2 - 3 + 1)> rate3;
std::array<mint, std::max(0, rank2 - 3 + 1)> irate3;
fft_info() {
root[rank2] = mint(g).pow((mint::mod() - 1) >> rank2);
iroot[rank2] = root[rank2].inv();
for (int i = rank2 - 1; i >= 0; i--) {
root[i] = root[i + 1] * root[i + 1];
iroot[i] = iroot[i + 1] * iroot[i + 1];
}
{
mint prod = 1, iprod = 1;
for (int i = 0; i <= rank2 - 2; i++) {
rate2[i] = root[i + 2] * prod;
irate2[i] = iroot[i + 2] * iprod;
prod *= iroot[i + 2];
iprod *= root[i + 2];
}
}
{
mint prod = 1, iprod = 1;
for (int i = 0; i <= rank2 - 3; i++) {
rate3[i] = root[i + 3] * prod;
irate3[i] = iroot[i + 3] * iprod;
prod *= iroot[i + 3];
iprod *= root[i + 3];
}
}
}
};
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
void butterfly(std::vector<mint>& a) {
int n = int(a.size());
int h = internal::countr_zero((unsigned int)n);
static const fft_info<mint> info;
int len = 0; // a[i, i+(n>>len), i+2*(n>>len), ..] is transformed
while (len < h) {
if (h - len == 1) {
int p = 1 << (h - len - 1);
mint rot = 1;
for (int s = 0; s < (1 << len); s++) {
int offset = s << (h - len);
for (int i = 0; i < p; i++) {
auto l = a[i + offset];
auto r = a[i + offset + p] * rot;
a[i + offset] = l + r;
a[i + offset + p] = l - r;
}
if (s + 1 != (1 << len))
rot *= info.rate2[countr_zero(~(unsigned int)(s))];
}
len++;
} else {
int p = 1 << (h - len - 2);
mint rot = 1, imag = info.root[2];
for (int s = 0; s < (1 << len); s++) {
mint rot2 = rot * rot;
mint rot3 = rot2 * rot;
int offset = s << (h - len);
for (int i = 0; i < p; i++) {
auto mod2 = 1ULL * mint::mod() * mint::mod();
auto a0 = 1ULL * a[i + offset].val();
auto a1 = 1ULL * a[i + offset + p].val() * rot.val();
auto a2 = 1ULL * a[i + offset + 2 * p].val() * rot2.val();
auto a3 = 1ULL * a[i + offset + 3 * p].val() * rot3.val();
auto a1na3imag =
1ULL * mint(a1 + mod2 - a3).val() * imag.val();
auto na2 = mod2 - a2;
a[i + offset] = a0 + a2 + a1 + a3;
a[i + offset + 1 * p] = a0 + a2 + (2 * mod2 - (a1 + a3));
a[i + offset + 2 * p] = a0 + na2 + a1na3imag;
a[i + offset + 3 * p] = a0 + na2 + (mod2 - a1na3imag);
}
if (s + 1 != (1 << len))
rot *= info.rate3[countr_zero(~(unsigned int)(s))];
}
len += 2;
}
}
}
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
void butterfly_inv(std::vector<mint>& a) {
int n = int(a.size());
int h = internal::countr_zero((unsigned int)n);
static const fft_info<mint> info;
int len = h; // a[i, i+(n>>len), i+2*(n>>len), ..] is transformed
while (len) {
if (len == 1) {
int p = 1 << (h - len);
mint irot = 1;
for (int s = 0; s < (1 << (len - 1)); s++) {
int offset = s << (h - len + 1);
for (int i = 0; i < p; i++) {
auto l = a[i + offset];
auto r = a[i + offset + p];
a[i + offset] = l + r;
a[i + offset + p] =
(unsigned long long)(mint::mod() + l.val() - r.val()) *
irot.val();
;
}
if (s + 1 != (1 << (len - 1)))
irot *= info.irate2[countr_zero(~(unsigned int)(s))];
}
len--;
} else {
int p = 1 << (h - len);
mint irot = 1, iimag = info.iroot[2];
for (int s = 0; s < (1 << (len - 2)); s++) {
mint irot2 = irot * irot;
mint irot3 = irot2 * irot;
int offset = s << (h - len + 2);
for (int i = 0; i < p; i++) {
auto a0 = 1ULL * a[i + offset + 0 * p].val();
auto a1 = 1ULL * a[i + offset + 1 * p].val();
auto a2 = 1ULL * a[i + offset + 2 * p].val();
auto a3 = 1ULL * a[i + offset + 3 * p].val();
auto a2na3iimag =
1ULL *
mint((mint::mod() + a2 - a3) * iimag.val()).val();
a[i + offset] = a0 + a1 + a2 + a3;
a[i + offset + 1 * p] =
(a0 + (mint::mod() - a1) + a2na3iimag) * irot.val();
a[i + offset + 2 * p] =
(a0 + a1 + (mint::mod() - a2) + (mint::mod() - a3)) *
irot2.val();
a[i + offset + 3 * p] =
(a0 + (mint::mod() - a1) + (mint::mod() - a2na3iimag)) *
irot3.val();
}
if (s + 1 != (1 << (len - 2)))
irot *= info.irate3[countr_zero(~(unsigned int)(s))];
}
len -= 2;
}
}
}
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
std::vector<mint> convolution_naive(const std::vector<mint>& a,
const std::vector<mint>& b) {
int n = int(a.size()), m = int(b.size());
std::vector<mint> ans(n + m - 1);
if (n < m) {
for (int j = 0; j < m; j++) {
for (int i = 0; i < n; i++) {
ans[i + j] += a[i] * b[j];
}
}
} else {
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
ans[i + j] += a[i] * b[j];
}
}
}
return ans;
}
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
std::vector<mint> convolution_fft(std::vector<mint> a, std::vector<mint> b) {
int n = int(a.size()), m = int(b.size());
int z = (int)internal::bit_ceil((unsigned int)(n + m - 1));
a.resize(z);
internal::butterfly(a);
b.resize(z);
internal::butterfly(b);
for (int i = 0; i < z; i++) {
a[i] *= b[i];
}
internal::butterfly_inv(a);
a.resize(n + m - 1);
mint iz = mint(z).inv();
for (int i = 0; i < n + m - 1; i++) a[i] *= iz;
return a;
}
} // namespace internal
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
std::vector<mint> convolution(std::vector<mint>&& a, std::vector<mint>&& b) {
int n = int(a.size()), m = int(b.size());
if (!n || !m) return {};
int z = (int)internal::bit_ceil((unsigned int)(n + m - 1));
assert((mint::mod() - 1) % z == 0);
if (std::min(n, m) <= 60) return convolution_naive(a, b);
return internal::convolution_fft(a, b);
}
template <class mint, internal::is_static_modint_t<mint>* = nullptr>
std::vector<mint> convolution(const std::vector<mint>& a,
const std::vector<mint>& b) {
int n = int(a.size()), m = int(b.size());
if (!n || !m) return {};
int z = (int)internal::bit_ceil((unsigned int)(n + m - 1));
assert((mint::mod() - 1) % z == 0);
if (std::min(n, m) <= 60) return convolution_naive(a, b);
return internal::convolution_fft(a, b);
}
template <unsigned int mod = 998244353,
class T,
std::enable_if_t<internal::is_integral<T>::value>* = nullptr>
std::vector<T> convolution(const std::vector<T>& a, const std::vector<T>& b) {
int n = int(a.size()), m = int(b.size());
if (!n || !m) return {};
using mint = static_modint<mod>;
int z = (int)internal::bit_ceil((unsigned int)(n + m - 1));
assert((mint::mod() - 1) % z == 0);
std::vector<mint> a2(n), b2(m);
for (int i = 0; i < n; i++) {
a2[i] = mint(a[i]);
}
for (int i = 0; i < m; i++) {
b2[i] = mint(b[i]);
}
auto c2 = convolution(std::move(a2), std::move(b2));
std::vector<T> c(n + m - 1);
for (int i = 0; i < n + m - 1; i++) {
c[i] = c2[i].val();
}
return c;
}
std::vector<long long> convolution_ll(const std::vector<long long>& a,
const std::vector<long long>& b) {
int n = int(a.size()), m = int(b.size());
if (!n || !m) return {};
static constexpr unsigned long long MOD1 = 754974721; // 2^24
static constexpr unsigned long long MOD2 = 167772161; // 2^25
static constexpr unsigned long long MOD3 = 469762049; // 2^26
static constexpr unsigned long long M2M3 = MOD2 * MOD3;
static constexpr unsigned long long M1M3 = MOD1 * MOD3;
static constexpr unsigned long long M1M2 = MOD1 * MOD2;
static constexpr unsigned long long M1M2M3 = MOD1 * MOD2 * MOD3;
static constexpr unsigned long long i1 =
internal::inv_gcd(MOD2 * MOD3, MOD1).second;
static constexpr unsigned long long i2 =
internal::inv_gcd(MOD1 * MOD3, MOD2).second;
static constexpr unsigned long long i3 =
internal::inv_gcd(MOD1 * MOD2, MOD3).second;
static constexpr int MAX_AB_BIT = 24;
static_assert(MOD1 % (1ull << MAX_AB_BIT) == 1, "MOD1 isn't enough to support an array length of 2^24.");
static_assert(MOD2 % (1ull << MAX_AB_BIT) == 1, "MOD2 isn't enough to support an array length of 2^24.");
static_assert(MOD3 % (1ull << MAX_AB_BIT) == 1, "MOD3 isn't enough to support an array length of 2^24.");
assert(n + m - 1 <= (1 << MAX_AB_BIT));
auto c1 = convolution<MOD1>(a, b);
auto c2 = convolution<MOD2>(a, b);
auto c3 = convolution<MOD3>(a, b);
std::vector<long long> c(n + m - 1);
for (int i = 0; i < n + m - 1; i++) {
unsigned long long x = 0;
x += (c1[i] * i1) % MOD1 * M2M3;
x += (c2[i] * i2) % MOD2 * M1M3;
x += (c3[i] * i3) % MOD3 * M1M2;
long long diff =
c1[i] - internal::safe_mod((long long)(x), (long long)(MOD1));
if (diff < 0) diff += MOD1;
static constexpr unsigned long long offset[5] = {
0, 0, M1M2M3, 2 * M1M2M3, 3 * M1M2M3};
x -= offset[diff % 5];
c[i] = x;
}
return c;
}
} // namespace atcoder
using namespace yosupo;
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <memory>
#include <utility>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#ifdef LOCAL
ostream& operator<<(ostream& os, __int128_t x) {
if (x < 0) {
os << "-";
x *= -1;
}
if (x == 0) {
return os << "0";
}
string s;
while (x) {
s += char(x % 10 + '0');
x /= 10;
}
reverse(s.begin(), s.end());
return os << s;
}
ostream& operator<<(ostream& os, __uint128_t x) {
if (x == 0) {
return os << "0";
}
string s;
while (x) {
s += char(x % 10 + '0');
x /= 10;
}
reverse(s.begin(), s.end());
return os << s;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p);
template <class T> ostream& operator<<(ostream& os, const V<T>& v);
template <class T> ostream& operator<<(ostream& os, const deque<T>& v);
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& a);
template <class T> ostream& operator<<(ostream& os, const set<T>& s);
template <class T, class U>
ostream& operator<<(ostream& os, const map<T, U>& m);
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
return os << "P(" << p.first << ", " << p.second << ")";
}
template <class T> ostream& operator<<(ostream& os, const V<T>& v) {
os << "[";
bool f = false;
for (auto d : v) {
if (f) os << ", ";
f = true;
os << d;
}
return os << "]";
}
template <class T> ostream& operator<<(ostream& os, const deque<T>& v) {
os << "[";
bool f = false;
for (auto d : v) {
if (f) os << ", ";
f = true;
os << d;
}
return os << "]";
}
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& a) {
os << "[";
bool f = false;
for (auto d : a) {
if (f) os << ", ";
f = true;
os << d;
}
return os << "]";
}
template <class T> ostream& operator<<(ostream& os, const set<T>& s) {
os << "{";
bool f = false;
for (auto d : s) {
if (f) os << ", ";
f = true;
os << d;
}
return os << "}";
}
template <class T> ostream& operator<<(ostream& os, const multiset<T>& s) {
os << "{";
bool f = false;
for (auto d : s) {
if (f) os << ", ";
f = true;
os << d;
}
return os << "}";
}
template <class T, class U>
ostream& operator<<(ostream& os, const map<T, U>& s) {
os << "{";
bool f = false;
for (auto p : s) {
if (f) os << ", ";
f = true;
os << p.first << ": " << p.second;
}
return os << "}";
}
struct PrettyOS {
ostream& os;
bool first;
template <class T> auto operator<<(T&& x) {
if (!first) os << ", ";
first = false;
os << x;
return *this;
}
};
template <class... T> void dbg0(T&&... t) {
(PrettyOS{cerr, true} << ... << t);
}
#define dbg(...) \
do { \
cerr << __LINE__ << " : " << #__VA_ARGS__ << " = "; \
dbg0(__VA_ARGS__); \
cerr << endl; \
} while (false);
#else
#define dbg(...)
#endif
Scanner sc = Scanner(stdin);
Printer pr = Printer(stdout);
const int D = 250010;
template <int MOD>
void match(V<int> a, V<int> b, V<bool>& ok) {
using mint = static_modint<MOD>;
// sum: a^3 b + a b^3 - 2 a^2 b^2
V<mint> sum(D + 1);
{
V<mint> a2(D + 1), b2(D + 1);
for (int i = 0; i <= D; i++) {
mint ai = a[i], bi = b[i];
a2[i] = ai * ai * ai;
b2[i] = bi;
}
auto c = atcoder::convolution(a2, b2);
for (int i = 0; i <= D; i++) {
sum[i] += c[D + i];
}
}
{
V<mint> a2(D + 1), b2(D + 1);
for (int i = 0; i <= D; i++) {
mint ai = a[i], bi = b[i];
a2[i] = ai;
b2[i] = bi * bi * bi;
}
auto c = atcoder::convolution(a2, b2);
for (int i = 0; i <= D; i++) {
sum[i] += c[D + i];
}
}
{
V<mint> a2(D + 1), b2(D + 1);
for (int i = 0; i <= D; i++) {
mint ai = a[i], bi = b[i];
a2[i] = ai * ai;
b2[i] = bi * bi;
}
auto c = atcoder::convolution(a2, b2);
for (int i = 0; i <= D; i++) {
sum[i] -= mint(2) * c[D + i];
}
}
for (int i = 0; i <= D; i++) {
if (sum[i].val()) {
ok[i] = true;
}
}
}
int main() {
int n, q;
sc.read(n, q);
V<int> x(n), col(n);
for (int i = 0; i < n; i++) {
sc.read(x[i], col[i]);
}
V<int> a(D + 1);
for (int i = 0; i < n; i++) {
a[x[i]] = col[i];
}
V<int> ans(D + 1);
int l = 1;
while (l <= n) {
// [l, 2l)
// want: c[d] = sum (a[i + d] op b[i])
// actual: c'[D + d] = sum (a[i + d] op b'[D - i])
V<int> b(D + 1);
for (int i = l; i < 2 * l; i++) {
if (i - 1 >= n) break;
b[D - x[i - 1]] = col[i - 1];
}
V<bool> ok(D + 1);
match<998244353>(a, b, ok);
match<754974721>(a, b, ok);
match<167772161>(a, b, ok);
match<469762049>(a, b, ok);
//dbg(l, 2 * l, ok);
for (int i = 0; i <= D; i++) {
if (ans[i] != 0) continue;
if (ok[i]) {
ans[i] = l + l/2;
}
}
l *= 2;
}
//dbg(ans);
for (int i = 0; i < q; i++) {
int d;
sc.read(d);
pr.writeln(ans[d]);
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1141ms
memory: 17024kb
input:
4 5 3 1 1 2 5 1 6 2 1 2 3 4 5
output:
3 3 1 3 0
result:
ok 5 numbers
Test #2:
score: 0
Accepted
time: 5239ms
memory: 17248kb
input:
10000 99999 67296 2 19835 1 93435 1 12756 2 38971 2 58322 2 4419 1 58583 1 68865 1 14192 1 66909 1 31419 2 40656 2 60289 2 79053 1 82880 1 28930 2 46115 1 9805 1 45096 2 29874 1 37171 2 55385 2 69812 1 16845 2 36030 2 58316 1 53401 1 35239 1 40363 1 29811 2 46440 2 98911 1 86466 2 9707 1 41909 2 616...
output:
48 96 12 48 96 6 3 48 12 3 3 24 24 48 6 12 48 6 96 3 96 3 3 6 24 12 12 48 24 96 12 96 12 12 12 3 24 12 12 96 24 6 24 12 12 6 12 3 24 12 48 12 48 12 48 24 12 48 48 24 24 48 24 48 12 3 12 12 12 24 24 3 48 6 96 48 48 48 12 12 24 1 48 3 12 12 12 24 24 12 48 6 6 48 48 6 3 24 6 6 24 48 6 12 48 12 96 96 48...
result:
ok 99999 numbers
Test #3:
score: 0
Accepted
time: 5642ms
memory: 17524kb
input:
30000 99999 51883 1 2142 1 69096 2 63011 1 70418 2 56529 1 65292 2 28901 2 78364 1 96477 1 43396 2 84388 1 29343 2 41141 2 94692 1 91222 1 30872 2 17288 2 11547 1 81095 2 16542 1 38652 1 54120 2 83684 2 70599 1 55085 1 91457 1 37800 1 46297 1 81164 1 79807 2 58484 1 43670 1 7180 2 58437 1 96924 2 63...
output:
3 1 3 24 6 12 12 6 3 6 1 6 6 12 12 3 12 1 6 3 1 3 12 12 12 1 12 3 1 3 6 12 1 3 24 12 24 12 1 6 1 3 6 6 6 6 3 6 3 3 12 12 24 3 6 6 3 6 12 3 12 24 6 6 1 3 6 24 6 3 3 3 6 24 3 3 3 6 6 12 12 12 6 24 12 12 1 6 6 3 1 12 24 12 3 3 6 6 3 12 12 12 1 6 12 12 6 1 1 12 6 6 1 6 1 6 3 3 3 6 6 12 12 12 6 1 3 3 6 1...
result:
ok 99999 numbers
Test #4:
score: 0
Accepted
time: 6428ms
memory: 17912kb
input:
100000 249999 101558 1 226768 2 215012 1 223802 2 3723 1 154951 1 95152 1 188191 2 128933 2 30706 1 141077 1 8377 2 160084 2 56011 1 11556 1 233668 2 42420 2 78212 1 245580 1 25824 2 61180 1 178193 2 179736 1 25607 2 160052 2 56056 2 93163 1 206849 2 28049 2 120634 2 44385 1 188594 1 195761 2 143744...
output:
12 6 3 1 3 3 12 3 3 3 12 6 1 6 3 6 24 1 3 3 12 1 1 6 3 24 12 3 1 3 12 6 3 1 1 12 6 6 1 1 12 6 1 12 1 6 6 6 24 6 1 6 1 12 3 12 6 1 1 12 3 6 6 12 6 12 3 1 6 6 3 3 12 3 6 1 12 1 12 6 6 12 3 1 6 3 6 3 1 6 1 6 1 3 12 3 12 3 3 6 6 6 1 6 6 3 6 3 3 3 3 3 3 6 1 6 6 6 6 1 6 1 6 6 1 6 3 12 1 6 6 3 3 1 6 1 3 1 ...
result:
ok 249999 numbers
Test #5:
score: 0
Accepted
time: 6761ms
memory: 18240kb
input:
150000 249999 29678 2 204012 1 242341 1 55873 2 133195 1 191930 2 158651 2 118376 2 166685 2 52303 2 77713 1 201614 2 135192 2 195257 1 42453 1 42856 1 205245 1 86911 2 192969 1 30106 1 78525 2 140326 2 144700 1 42186 1 215224 2 19113 2 160246 1 159685 1 10602 1 137178 1 102450 1 137587 2 171123 2 1...
output:
1 12 3 1 3 1 12 6 6 6 3 3 3 3 12 3 3 6 6 1 3 1 3 6 12 3 1 3 6 3 6 1 1 6 6 6 1 3 6 6 3 1 1 6 6 3 1 1 3 1 3 3 12 6 1 3 1 12 3 3 12 6 6 1 12 1 6 12 1 3 3 3 6 6 6 1 12 3 3 3 6 1 6 6 6 3 3 3 6 3 1 1 1 3 6 6 6 1 1 3 3 3 1 6 1 6 6 3 6 6 1 12 3 1 1 6 3 6 3 1 12 1 1 3 1 6 3 3 6 3 1 3 3 3 1 3 1 1 1 6 1 12 3 3...
result:
ok 249999 numbers
Test #6:
score: 0
Accepted
time: 6776ms
memory: 18700kb
input:
200000 249999 6248 1 183259 1 153451 2 85616 1 114994 2 98565 1 151656 1 220307 1 178381 2 11378 2 229267 2 229745 2 121994 2 127081 1 49355 1 227953 2 110071 1 227824 1 18185 2 140762 2 98797 1 3337 1 229512 2 31126 2 180753 1 206940 1 130823 2 115947 2 201783 1 113674 2 155525 2 112976 2 66144 1 1...
output:
3 6 3 3 3 1 3 3 6 3 1 6 1 1 1 1 1 3 12 6 3 1 3 3 3 1 1 1 3 3 6 3 1 3 1 3 1 1 1 1 3 3 6 1 1 1 6 1 3 1 3 3 12 6 3 1 3 3 1 3 1 1 3 3 6 3 1 1 1 1 3 1 12 12 3 1 3 1 3 3 1 1 1 3 1 1 1 6 6 1 1 1 3 3 1 1 1 3 1 1 3 1 3 6 6 3 3 6 6 3 1 1 3 3 6 3 6 3 1 3 6 3 1 1 6 1 3 1 6 1 1 1 3 1 6 3 1 1 3 1 1 3 3 1 3 1 1 3 ...
result:
ok 249999 numbers
Test #7:
score: 0
Accepted
time: 6803ms
memory: 19088kb
input:
250000 249999 43395 2 176047 2 182604 2 174584 1 84087 1 171284 2 62939 2 167394 1 91843 1 6316 1 172364 1 60476 1 137969 2 164958 1 49683 2 230414 1 106627 1 120532 1 245073 2 179049 2 34146 2 88698 1 150706 1 99450 1 241792 2 70708 1 69060 2 175739 1 38005 2 65970 1 66335 2 182109 1 32837 1 71265 ...
output:
1 1 3 1 3 1 1 3 3 3 1 12 3 3 1 1 3 1 1 1 3 3 3 6 3 1 1 3 3 1 6 3 3 6 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 6 3 1 3 6 3 1 1 3 6 3 1 3 3 1 1 1 1 1 6 3 1 3 1 6 1 1 1 3 1 3 1 3 3 1 6 3 1 1 1 3 1 1 3 1 3 1 1 3 3 1 3 6 3 3 1 3 6 1 1 3 1 1 3 6 1 1 1 3 3 3 1 1 1 3 1 1 3 1 1 1 3 3 1 1 6 1 3 1 3 1 3 3 12 1 3 1 1 1 ...
result:
ok 249999 numbers
Test #8:
score: 0
Accepted
time: 6424ms
memory: 17900kb
input:
100000 249999 15193 3 145839 3 79432 1 108888 2 236993 3 238864 2 96951 2 249086 3 46743 1 32398 3 138017 3 52120 2 230778 2 21656 3 62564 3 208611 2 108357 1 235637 2 247827 1 247624 2 128781 2 13021 1 55702 2 43874 1 126878 2 177432 3 30826 3 100406 3 7564 1 201946 2 52522 3 249872 1 79661 3 13976...
output:
6 12 3 1 3 1 3 12 3 6 3 3 6 1 3 1 12 1 3 3 6 6 6 3 1 3 6 12 3 3 1 1 3 1 24 1 1 1 3 1 6 12 3 1 3 6 12 1 1 6 3 1 1 6 6 3 3 1 3 3 24 1 1 3 6 6 1 3 3 1 1 3 1 6 1 1 1 3 6 3 6 6 6 6 1 3 3 12 6 3 12 1 6 6 6 3 3 6 3 3 6 6 6 3 1 12 6 1 1 3 1 24 3 12 3 1 3 3 1 1 1 1 3 6 1 3 1 3 3 3 24 6 6 1 3 3 6 1 6 3 3 3 1 ...
result:
ok 249999 numbers
Test #9:
score: 0
Accepted
time: 6775ms
memory: 18308kb
input:
150000 249999 151797 3 132264 2 228119 2 62624 3 122655 1 93048 2 120758 3 96298 1 127189 3 79578 1 233029 1 166678 2 73775 2 132317 2 51322 1 6343 1 176933 2 106261 1 36493 2 159428 3 112870 3 117448 3 93008 1 154295 2 190828 2 74969 1 240852 1 46624 2 241429 3 65645 1 212721 2 110548 2 118236 2 20...
output:
3 1 1 3 3 3 1 3 6 6 3 3 6 6 3 1 3 6 3 3 1 6 1 6 3 1 3 1 1 1 1 3 1 3 3 6 3 1 3 1 12 3 6 1 6 6 1 12 6 1 1 1 3 3 3 1 6 3 1 3 3 1 1 3 6 1 6 3 3 1 3 1 1 6 1 1 1 1 3 1 1 1 1 3 1 1 3 6 1 3 3 1 3 1 1 6 6 6 3 1 3 1 3 6 6 6 1 1 3 3 3 3 3 1 1 6 1 3 1 3 3 6 3 1 3 6 1 12 3 3 3 3 3 3 3 1 1 6 3 1 6 3 6 3 1 3 1 6 3...
result:
ok 249999 numbers
Test #10:
score: 0
Accepted
time: 6875ms
memory: 18696kb
input:
200000 249999 47041 3 73295 1 221000 1 53265 2 201031 3 222816 2 231867 2 175711 2 150407 1 172427 1 241001 2 192843 2 13671 1 231028 3 208391 2 171533 2 166545 2 97954 3 192317 2 208872 1 231857 1 113741 1 219000 1 192008 3 112701 1 244639 3 224948 1 13585 2 184997 1 179230 3 149300 1 169950 1 9416...
output:
3 1 1 3 3 1 3 3 3 3 3 3 1 3 1 1 1 1 1 1 3 1 1 3 1 6 3 3 1 1 1 3 1 3 1 3 1 1 1 1 1 3 1 1 1 3 6 6 1 1 6 3 1 1 1 3 3 1 1 3 1 3 1 1 1 1 1 6 1 3 1 3 1 1 1 3 1 6 3 3 3 3 3 3 3 1 3 1 3 1 1 1 1 3 1 3 3 3 1 1 3 1 1 12 3 3 1 1 1 1 1 1 3 3 1 6 3 1 1 1 3 6 1 3 3 3 1 1 3 6 6 3 3 1 3 3 1 3 1 1 1 1 3 1 1 1 6 1 3 1...
result:
ok 249999 numbers
Test #11:
score: 0
Accepted
time: 6842ms
memory: 19036kb
input:
250000 249999 18119 2 48006 3 232814 2 214885 3 10886 3 761 1 28565 2 127342 3 100481 2 91912 2 169408 3 198992 3 32749 2 20324 3 32474 1 38005 2 240939 2 215900 2 200682 1 432 1 5669 3 84940 3 56161 1 203677 1 241950 1 113041 1 138836 3 153159 3 81938 1 61416 3 239183 2 180390 3 83045 3 107312 1 22...
output:
3 1 1 1 6 3 1 1 3 3 3 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 6 1 1 1 3 1 1 3 1 1 3 1 6 3 3 1 3 3 3 1 1 3 6 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 3 1 1 1 6 1 1 3 1 6 1 3 3 1 1 3 1 1 3 6 1 1 3 1 1 1 1 3 1 1 1 3 3 3 1 1 1 1 3 1 3 1 1 1 1 1 1 1 1 3 3 1 1 1 1 3 1 1 1 1 1 1 ...
result:
ok 249999 numbers
Test #12:
score: 0
Accepted
time: 6461ms
memory: 17996kb
input:
100000 249999 224336 2 97421 4 237741 10 33517 3 217556 5 236052 6 13864 5 189562 1 209432 1 150833 7 94408 10 220716 3 83847 9 61678 7 95666 3 36542 1 162104 1 158517 6 33248 8 43402 1 18134 8 112042 9 202559 9 183144 6 24872 6 27758 7 217309 8 73017 1 59520 9 187721 10 100252 6 138484 7 165554 7 1...
output:
6 12 6 1 1 6 1 3 6 3 1 6 12 3 12 3 3 1 3 3 3 6 3 1 1 6 3 6 3 6 3 3 3 3 6 3 3 1 6 1 1 12 1 3 3 1 1 3 1 1 1 3 3 1 12 1 6 1 6 1 3 6 3 1 12 3 1 1 1 6 12 1 12 3 3 6 3 3 3 3 3 3 3 1 1 3 24 3 6 3 1 3 3 1 6 6 1 6 3 3 3 3 1 6 3 1 24 1 3 3 6 3 1 3 1 3 1 1 1 3 1 1 1 1 1 6 1 1 1 3 1 1 1 3 3 1 6 3 1 1 3 3 1 1 3 ...
result:
ok 249999 numbers
Test #13:
score: 0
Accepted
time: 6850ms
memory: 18276kb
input:
150000 249999 166792 6 238330 4 84379 10 131925 6 168914 7 96461 6 127762 9 204071 4 243519 8 198906 6 161831 7 131281 8 115061 10 69493 4 208817 9 4190 10 195480 10 51511 6 80200 5 81104 6 131338 8 100895 2 207427 4 237681 3 206143 4 224139 6 17948 8 228982 10 200256 8 36233 9 146742 6 162442 2 165...
output:
1 3 3 3 3 1 1 1 1 1 3 1 3 3 1 6 3 3 1 1 6 1 3 6 1 1 3 3 1 3 1 3 3 1 3 6 1 1 1 1 1 1 3 1 6 3 3 3 6 1 1 1 1 3 3 1 3 12 6 1 1 1 1 3 3 1 6 1 1 1 3 1 3 1 1 1 1 1 3 3 3 1 3 3 6 3 1 1 1 1 3 3 1 3 1 1 3 1 1 1 1 1 6 1 1 1 3 12 3 3 3 1 1 3 3 3 1 3 6 3 1 3 3 1 3 3 1 3 3 3 1 1 3 1 1 1 1 3 3 1 1 1 6 1 1 3 1 1 1 ...
result:
ok 249999 numbers
Test #14:
score: 0
Accepted
time: 6796ms
memory: 18620kb
input:
200000 249999 200627 8 155259 8 116629 3 7460 8 212178 2 236426 2 247999 4 58552 9 226174 3 136423 3 68187 1 223717 1 115991 3 96943 9 99300 3 196487 3 82852 9 21321 8 146283 2 173037 8 22904 7 198079 10 22919 1 95543 6 237838 2 248787 7 186160 8 201677 8 44573 7 55166 3 60479 6 247478 2 247081 10 3...
output:
1 1 1 1 1 3 1 1 1 1 6 1 1 1 3 1 3 1 1 1 1 1 1 1 3 3 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 6 1 1 1 1 1 1 1 3 1 6 1 3 1 1 1 1 3 1 3 1 1 3 1 3 3 1 1 1 3 1 1 1 1 1 3 1 1 3 3 1 3 1 1 3 1 1 1 6 1 1 1 1 1 3 1 1 1 1 3 1 1 1 3 3 3 3 1 1 3 3 3 1 1 3 1 1 1 1 1 1 1 1 3 3 1 3 1 3 1 1 3 3 3 1 1 ...
result:
ok 249999 numbers
Test #15:
score: 0
Accepted
time: 6821ms
memory: 19132kb
input:
250000 249999 14095 6 220950 6 234662 3 35913 1 132258 4 200544 10 135104 7 148916 1 13117 5 190176 9 222898 8 91946 4 178090 4 18354 1 151369 2 12233 6 228757 6 161742 7 33667 9 79810 1 74379 10 162789 3 196843 7 223296 9 78881 10 103789 5 84979 7 234254 5 80219 2 27415 7 65636 6 245431 4 16975 7 2...
output:
3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 3 1 1 3 1 3 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 ...
result:
ok 249999 numbers
Test #16:
score: 0
Accepted
time: 6763ms
memory: 19264kb
input:
250000 249999 234423 1 106490 1 209289 1 86924 1 54501 1 166355 1 228761 1 165944 1 172158 1 64661 1 167348 1 196763 1 98465 1 56621 1 138329 1 149908 1 58448 1 231726 1 171821 1 203962 1 80624 1 299 1 16257 1 193382 1 226372 1 103199 1 160198 1 206884 1 43643 1 246448 1 197980 1 164317 1 228968 1 1...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok 249999 numbers
Test #17:
score: 0
Accepted
time: 6380ms
memory: 18000kb
input:
100000 249999 93220 59 126118 58 114760 31 127602 91 78964 37 107468 28 17418 34 20051 6 25078 32 238158 11 143557 45 177110 45 101603 44 55221 8 27168 33 12698 44 96309 71 228393 7 85535 53 161888 73 97093 73 177327 72 151564 44 113400 33 80491 47 62362 93 15475 4 134593 67 204219 69 128232 67 1335...
output:
1 1 3 1 3 12 1 3 1 3 3 6 3 1 1 3 1 1 1 1 1 3 3 12 1 3 1 1 1 6 6 1 1 3 1 1 3 1 1 3 3 1 3 3 1 3 1 3 1 1 3 3 1 1 1 3 3 1 3 3 6 3 1 3 3 1 1 3 1 3 1 1 1 1 1 3 6 6 3 3 12 6 3 1 3 3 3 6 3 1 6 1 3 1 6 3 1 1 3 1 1 3 1 1 3 3 3 3 1 1 1 6 6 6 1 3 1 1 12 1 1 6 1 3 1 1 1 1 1 3 3 3 1 6 1 3 6 1 1 3 6 1 3 1 3 1 6 1 ...
result:
ok 249999 numbers
Test #18:
score: 0
Accepted
time: 6811ms
memory: 18460kb
input:
150000 249999 104484 72 183971 17 236903 47 85763 51 109721 7 115135 100 162866 62 13428 6 134736 85 108324 46 94466 1 175154 17 72231 54 166036 34 198137 84 146960 74 90976 26 210020 89 205699 80 7068 76 192964 51 93065 27 166315 35 80521 64 41842 13 83346 79 119551 5 96204 72 97493 66 92835 15 312...
output:
1 1 1 6 1 3 1 1 1 3 1 3 1 3 1 1 1 3 1 1 3 1 3 1 1 6 1 1 1 3 1 1 1 3 1 6 1 1 1 1 1 1 3 3 3 1 1 3 3 3 3 3 1 3 1 1 3 3 1 1 3 3 3 1 1 3 1 1 3 1 1 1 1 1 6 1 3 3 1 3 3 1 1 1 1 1 3 3 1 3 3 6 1 1 1 1 3 3 3 3 1 1 1 3 1 3 1 1 6 1 1 3 3 1 1 1 1 1 1 3 6 3 1 3 1 1 1 6 1 3 3 3 1 1 3 3 1 6 1 3 3 3 1 3 3 1 1 3 3 1 ...
result:
ok 249999 numbers
Test #19:
score: 0
Accepted
time: 6798ms
memory: 18856kb
input:
200000 249999 47102 39 120564 49 211340 98 112018 76 128324 79 13658 56 145481 5 212577 92 153372 83 195457 13 67116 53 183188 95 159717 50 223315 42 123415 47 143994 74 39260 51 58850 22 198700 27 22129 53 244348 12 112600 33 93161 52 165358 80 162648 46 238139 8 224484 6 236710 2 45342 99 44056 3 ...
output:
1 1 1 1 1 1 1 3 3 1 3 1 1 3 1 1 1 3 1 1 1 1 3 1 1 3 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 3 1 1 1 3 1 1 1 3 1 1 1 3 1 1 1 1 3 1 1 1 1 3 1 1 3 3 3 3 1 1 1 3 1 1 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 1 3 1 1 1 3 1 1 1 1 3 1 3 1 1 1 1 3 1 ...
result:
ok 249999 numbers
Test #20:
score: 0
Accepted
time: 6793ms
memory: 19100kb
input:
250000 249999 113549 52 245740 8 25655 22 218082 47 132245 45 218861 28 37315 30 111164 95 14826 36 107398 37 156792 14 48628 66 132434 72 28151 59 158589 94 7348 97 56728 5 190552 8 170423 55 65115 44 106177 86 202419 88 183685 47 200452 7 72434 8 161099 94 95797 19 92937 7 75848 100 238323 38 1721...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 249999 numbers
Test #21:
score: 0
Accepted
time: 6418ms
memory: 18004kb
input:
100000 249999 215178 78 137308 320 85918 996 37671 196 229886 523 231932 923 231942 388 174478 949 3670 606 187312 514 113705 684 239037 255 207483 436 54280 528 227569 162 29778 206 139135 341 39789 362 191291 41 102694 729 208895 941 57449 360 30418 630 123629 754 39958 20 220635 888 43818 148 531...
output:
3 3 3 3 6 1 6 1 1 1 1 1 1 3 6 3 6 3 1 1 1 1 3 3 6 6 3 6 6 3 12 3 3 3 1 3 6 3 6 1 3 3 3 1 1 3 1 3 1 1 1 1 3 1 1 6 6 1 6 3 1 3 1 3 1 1 6 3 1 6 1 3 1 3 6 1 1 1 3 1 3 1 1 3 6 1 1 3 3 1 1 3 1 1 1 12 1 1 3 12 3 1 3 1 3 3 12 1 6 3 1 3 1 3 1 3 6 1 3 3 1 1 12 3 3 3 1 1 3 1 1 1 1 1 1 1 1 3 6 3 3 3 1 1 6 1 3 1...
result:
ok 249999 numbers
Test #22:
score: 0
Accepted
time: 6817ms
memory: 18420kb
input:
150000 249999 168799 574 236614 391 5626 61 80977 154 38826 825 210532 62 100484 431 137419 781 103555 171 155556 287 247529 26 33559 487 177031 92 195197 875 91976 329 199343 636 83803 545 106072 247 123800 617 25942 788 235116 540 75666 678 240796 87 116602 682 229461 207 234450 428 235548 279 159...
output:
1 3 1 1 3 1 1 1 1 1 3 3 6 1 1 1 1 1 3 1 1 3 1 1 1 1 1 6 3 1 1 6 1 1 1 1 1 1 1 6 3 1 3 1 1 3 3 1 1 1 6 1 1 1 1 1 1 1 3 3 1 3 3 3 3 1 6 3 1 3 1 3 1 3 3 1 3 3 1 1 1 1 3 3 3 3 1 6 1 3 1 3 3 1 3 1 3 1 3 1 3 1 1 3 1 6 1 1 3 3 1 1 1 6 6 3 1 1 1 1 1 1 3 1 3 1 3 1 1 3 1 1 12 3 3 6 3 1 1 1 3 3 6 1 1 1 1 1 3 1...
result:
ok 249999 numbers
Test #23:
score: 0
Accepted
time: 6746ms
memory: 18644kb
input:
200000 249999 220479 940 50222 148 184880 27 222833 69 4952 631 43460 820 140864 16 15536 585 121758 416 81558 785 139693 320 164815 379 6191 763 223454 81 202200 271 68519 74 25162 498 51853 454 170830 650 123228 426 131945 392 191834 517 152172 502 117499 506 103682 415 245558 424 146040 951 87752...
output:
1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 3 3 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 1 1 3 1 1 3 1 1 1 1 1 3 1 1 1 1 1 3 3 1 1 3 1 3 1 1 1 1 1 1 3 1 3 1 3 1 1 1 1 3 1 3 3 1 3 1 1 3 1 1 1 3 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 3 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 3 3 1 3 3 1 1 3 1 1 1 1 1 1 3 1 1 1 1 3 1 1 1 ...
result:
ok 249999 numbers
Test #24:
score: 0
Accepted
time: 6779ms
memory: 19256kb
input:
250000 249999 71099 140 102518 514 183279 196 9460 731 155766 741 159169 471 240491 548 72124 713 92079 572 102680 262 27525 958 1818 610 245646 611 85560 428 14629 438 195435 311 30920 702 105014 531 9136 11 134312 381 88919 991 56603 642 102308 551 68202 138 12583 498 88565 667 69470 82 213748 540...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 249999 numbers
Test #25:
score: 0
Accepted
time: 6435ms
memory: 17860kb
input:
100000 249999 143875 3079 35794 9717 78870 1826 154059 3784 185253 1989 50422 6248 142560 6933 142367 7270 199873 8171 232637 2149 766 6740 128174 8273 174253 2020 71559 974 33140 3168 247328 4196 235516 7852 118076 6395 165442 1875 15428 8418 143016 5686 122930 6 97686 6807 215402 719 152923 7495 1...
output:
3 6 1 6 1 6 3 1 3 1 3 1 3 3 3 3 12 3 6 12 6 6 6 1 1 3 6 3 3 1 3 1 3 3 1 6 1 3 1 6 12 3 3 6 3 1 1 3 1 6 3 6 3 3 3 3 6 12 1 1 1 6 1 1 1 3 3 1 3 12 3 1 1 6 1 3 3 1 6 6 1 6 6 1 3 1 1 1 6 3 1 1 6 3 1 3 12 1 6 6 3 3 6 1 1 3 6 6 1 3 1 1 3 6 1 3 1 3 1 3 1 3 1 1 3 1 3 6 3 3 3 3 3 1 1 3 3 6 12 6 3 6 6 3 3 3 6...
result:
ok 249999 numbers
Test #26:
score: 0
Accepted
time: 6740ms
memory: 18356kb
input:
150000 249999 208515 1037 226810 8037 78579 8990 196348 454 52075 3057 210394 7076 132508 6037 33903 3827 45161 3699 181439 3102 81472 8711 241071 8091 177966 9734 10995 5634 142541 4395 150681 2847 64108 3634 236691 6727 44362 3578 91381 3400 115765 7253 95492 6997 86886 4546 137861 3681 89217 9885...
output:
1 1 1 1 1 3 1 3 1 1 1 1 1 3 1 1 1 3 1 3 1 1 1 1 3 3 1 3 1 1 1 1 1 6 1 1 1 1 1 3 3 3 3 1 1 1 3 1 3 1 1 1 3 6 1 1 1 1 12 3 1 1 1 1 1 1 3 1 1 1 3 1 3 1 1 3 3 1 3 1 1 3 1 3 1 1 1 1 1 3 1 1 1 1 6 3 1 1 3 1 3 1 6 3 3 1 1 3 1 1 1 1 1 1 3 3 1 1 1 1 1 1 3 6 3 1 3 1 1 1 1 1 1 1 3 1 1 1 3 1 3 1 1 1 1 3 6 1 1 3...
result:
ok 249999 numbers
Test #27:
score: 0
Accepted
time: 6829ms
memory: 18828kb
input:
200000 249999 19515 6770 260 7289 46752 6511 235290 1326 69396 2617 218263 711 68770 3615 160983 5021 74125 2662 245771 8858 224783 7181 235656 4986 163114 3041 101632 1797 64682 4595 22763 4476 145956 9767 50440 3970 20831 9646 32979 365 147294 5959 5700 3518 167684 258 105791 2718 129850 8902 2168...
output:
1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 1 3 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 6 1 1 1 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 3 1 3 1 3 1 1 1 1 3 1 1 1 1 1 1 3 3 1 1 1 3 1 1 1 1 3 3 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 3 1 3 3 1 1 1 1 ...
result:
ok 249999 numbers
Test #28:
score: 0
Accepted
time: 6836ms
memory: 19172kb
input:
250000 249999 233586 2024 249814 5609 98965 9482 21269 7996 112196 3685 56401 4243 248656 5822 246725 8874 239803 3997 154988 7106 163971 9153 17019 4804 114980 9267 15470 7944 148695 5822 48302 5830 17357 1357 85078 1597 217000 5941 193654 6835 41788 6310 84917 509 111123 2589 219424 5680 217784 85...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 249999 numbers
Test #29:
score: 0
Accepted
time: 6366ms
memory: 17912kb
input:
100000 249999 218060 20345 27334 62482 125176 75231 164701 51166 191015 8172 197002 40902 212572 96076 79429 83748 8322 65763 117710 55688 163851 18354 61106 26868 169159 5528 85864 73608 229644 69531 69326 96862 136553 87015 41717 8087 3709 40727 233990 84886 99712 32178 217040 75596 149456 83736 1...
output:
1 3 1 1 3 6 1 3 3 1 1 3 3 3 6 3 3 3 3 3 3 6 3 3 3 3 6 3 3 6 12 3 1 3 3 1 1 1 3 6 3 1 3 1 6 3 3 1 6 1 6 1 1 3 3 6 6 3 3 3 1 3 1 3 3 1 1 6 3 1 1 3 12 3 3 3 3 3 3 6 3 6 1 1 1 3 3 3 1 1 1 3 6 1 3 6 3 1 3 6 6 3 1 1 1 1 3 3 3 3 3 1 1 3 1 12 3 3 3 6 12 1 12 24 1 6 1 1 3 1 1 1 3 3 1 3 1 3 3 1 1 3 6 3 1 3 1 ...
result:
ok 249999 numbers
Test #30:
score: 0
Accepted
time: 6751ms
memory: 18256kb
input:
150000 249999 234931 117721 165760 121374 39901 90389 65401 36642 127661 143888 111190 11903 248547 55018 25670 51452 29737 77284 34785 88158 41023 86741 210736 96409 45042 131729 156818 38710 102234 58616 229573 45925 240495 63260 27301 13493 239464 120694 57130 18370 65373 113177 200234 111599 813...
output:
1 3 1 1 3 1 1 6 1 3 6 1 1 3 3 1 1 1 1 3 3 3 3 6 1 3 3 6 1 3 3 1 1 3 1 3 3 6 1 3 3 1 1 6 1 3 3 1 1 3 1 1 1 1 3 1 3 1 3 1 3 1 1 3 1 1 1 1 6 1 1 1 1 1 1 3 3 3 3 1 1 3 1 1 1 1 3 1 1 3 3 1 1 3 1 1 1 6 1 1 1 3 1 3 1 3 1 1 1 1 1 1 1 6 1 1 3 1 1 1 1 1 6 1 1 1 1 3 1 3 1 3 3 3 3 1 1 1 1 1 1 1 1 1 3 1 3 1 1 1 ...
result:
ok 249999 numbers
Test #31:
score: 0
Accepted
time: 6811ms
memory: 18604kb
input:
200000 249999 115119 166519 203638 63359 136662 96182 198943 18205 186741 173012 170532 142299 132543 22820 152237 171263 248127 46558 134531 159448 113450 155775 26555 131466 9868 37421 45419 144841 199395 140829 110924 34275 83572 11001 48496 65156 133341 100284 141543 60021 170546 6240 231712 152...
output:
1 1 1 1 3 1 1 1 3 1 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 3 3 3 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 3 1 1 1 1 1 3 1 3 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 3 6 1 3 1 1 1 1 3 1 ...
result:
ok 249999 numbers
Test #32:
score: 0
Accepted
time: 6757ms
memory: 19128kb
input:
250000 249999 81716 70790 72006 29146 86672 228636 88825 53682 198298 58728 197705 130597 169560 249058 143240 6263 156637 225375 177754 174622 67575 6866 139636 192494 53704 155110 8984 209943 65297 79914 153405 142122 225695 169949 96758 194754 245965 121739 212635 243505 234106 28727 242548 11416...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 249999 numbers
Test #33:
score: 0
Accepted
time: 6755ms
memory: 19132kb
input:
250000 249999 250000 1 249999 1 249998 2 249997 2 249996 3 249995 3 249994 4 249993 4 249992 5 249991 5 249990 6 249989 6 249988 7 249987 7 249986 8 249985 8 249984 9 249983 9 249982 10 249981 10 249980 11 249979 11 249978 12 249977 12 249976 13 249975 13 249974 14 249973 14 249972 15 249971 15 2499...
output:
3 3 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #34:
score: 0
Accepted
time: 6757ms
memory: 19204kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 2 249996 2 249995 2 249994 3 249993 3 249992 3 249991 4 249990 4 249989 4 249988 5 249987 5 249986 5 249985 6 249984 6 249983 6 249982 7 249981 7 249980 7 249979 8 249978 8 249977 8 249976 9 249975 9 249974 9 249973 10 249972 10 249971 10 249970 11 249...
output:
6 6 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #35:
score: 0
Accepted
time: 6740ms
memory: 19248kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 2 249994 2 249993 2 249992 2 249991 2 249990 3 249989 3 249988 3 249987 3 249986 3 249985 4 249984 4 249983 4 249982 4 249981 4 249980 5 249979 5 249978 5 249977 5 249976 5 249975 6 249974 6 249973 6 249972 6 249971 6 249970 7 249969 ...
output:
6 6 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #36:
score: 0
Accepted
time: 6831ms
memory: 19184kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #37:
score: 0
Accepted
time: 6754ms
memory: 19000kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 ...
result:
ok 249999 numbers
Test #38:
score: 0
Accepted
time: 6820ms
memory: 19204kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 ...
result:
ok 249999 numbers
Test #39:
score: 0
Accepted
time: 6804ms
memory: 19308kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 ...
result:
ok 249999 numbers
Test #40:
score: 0
Accepted
time: 6752ms
memory: 19188kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608...
result:
ok 249999 numbers
Test #41:
score: 0
Accepted
time: 6380ms
memory: 18068kb
input:
100000 250000 100000 1 99999 1 99998 1 99997 1 99996 1 99995 1 99994 1 99993 1 99992 1 99991 1 99990 1 99989 1 99988 1 99987 1 99986 1 99985 1 99984 1 99983 1 99982 1 99981 1 99980 1 99979 1 99978 1 99977 1 99976 1 99975 1 99974 1 99973 1 99972 1 99971 1 99970 1 99969 1 99968 1 99967 1 99966 1 99965...
output:
24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 24576 ...
result:
ok 250000 numbers
Test #42:
score: 0
Accepted
time: 6850ms
memory: 19160kb
input:
250000 249999 250000 1 249999 1 249998 2 249997 2 249996 3 249995 3 249994 4 249993 4 249992 5 249991 5 249990 6 249989 6 249988 7 249987 7 249986 8 249985 8 249984 9 249983 9 249982 10 249981 10 249980 11 249979 11 249978 12 249977 12 249976 13 249975 13 249974 14 249973 14 249972 15 249971 15 2499...
output:
3 3 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #43:
score: 0
Accepted
time: 6758ms
memory: 19244kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 2 249996 2 249995 2 249994 3 249993 3 249992 3 249991 4 249990 4 249989 4 249988 5 249987 5 249986 5 249985 6 249984 6 249983 6 249982 7 249981 7 249980 7 249979 8 249978 8 249977 8 249976 9 249975 9 249974 9 249973 10 249972 10 249971 10 249970 11 249...
output:
6 6 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #44:
score: 0
Accepted
time: 6771ms
memory: 19000kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 2 249994 2 249993 2 249992 2 249991 2 249990 3 249989 3 249988 3 249987 3 249986 3 249985 4 249984 4 249983 4 249982 4 249981 4 249980 5 249979 5 249978 5 249977 5 249976 5 249975 6 249974 6 249973 6 249972 6 249971 6 249970 7 249969 ...
output:
6 6 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #45:
score: 0
Accepted
time: 6797ms
memory: 19076kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 249999 numbers
Test #46:
score: 0
Accepted
time: 6780ms
memory: 19224kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 384 ...
result:
ok 249999 numbers
Test #47:
score: 0
Accepted
time: 6736ms
memory: 19092kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 6144 ...
result:
ok 249999 numbers
Test #48:
score: 0
Accepted
time: 6755ms
memory: 19128kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 49152 ...
result:
ok 249999 numbers
Test #49:
score: 0
Accepted
time: 6726ms
memory: 19120kb
input:
250000 249999 250000 1 249999 1 249998 1 249997 1 249996 1 249995 1 249994 1 249993 1 249992 1 249991 1 249990 1 249989 1 249988 1 249987 1 249986 1 249985 1 249984 1 249983 1 249982 1 249981 1 249980 1 249979 1 249978 1 249977 1 249976 1 249975 1 249974 1 249973 1 249972 1 249971 1 249970 1 249969 ...
output:
196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608 196608...
result:
ok 249999 numbers
Test #50:
score: 0
Accepted
time: 6795ms
memory: 19172kb
input:
250000 250000 250000 1 249999 2 249998 2 249997 2 249996 2 249995 2 249994 2 249993 2 249992 2 249991 2 249990 2 249989 2 249988 2 249987 2 249986 2 249985 2 249984 2 249983 2 249982 2 249981 2 249980 2 249979 2 249978 2 249977 2 249976 2 249975 2 249974 2 249973 2 249972 2 249971 2 249970 2 249969 ...
output:
3 3 6 6 6 6 12 12 12 12 12 12 12 12 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 96 ...
result:
ok 250000 numbers
Extra Test:
score: 0
Extra Test Passed