QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#625502 | #9438. Two Box | maspy | AC ✓ | 2024ms | 272892kb | C++20 | 29.2kb | 2024-10-09 19:33:54 | 2024-10-09 19:33:54 |
Judging History
answer
#line 1 "/home/maspy/compro/library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define FOR_subset(t, s) for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_mod_2(int x) { return __builtin_parity(x); }
int popcnt_mod_2(u32 x) { return __builtin_parity(x); }
int popcnt_mod_2(ll x) { return __builtin_parityll(x); }
int popcnt_mod_2(u64 x) { return __builtin_parityll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T>
T floor(T a, T b) {
return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sm = 0;
for (auto &&a: A) sm += a;
return sm;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
if (check_ok) assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
(check(x) ? ok : ng) = x;
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
(check(x) ? ok : ng) = x;
}
return (ok + ng) / 2;
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
return (a > b ? a = b, 1 : 0);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
vc<T> &res = first;
(res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "/home/maspy/compro/library/other/io.hpp"
#define FASTIO
#include <unistd.h>
// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;
struct Pre {
char num[10000][4];
constexpr Pre() : num() {
for (int i = 0; i < 10000; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i][j] = n % 10 | '0';
n /= 10;
}
}
}
} constexpr pre;
inline void load() {
memcpy(ibuf, ibuf + pil, pir - pil);
pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
pil = 0;
if (pir < SZ) ibuf[pir++] = '\n';
}
inline void flush() {
fwrite(obuf, 1, por, stdout);
por = 0;
}
void rd(char &c) {
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
}
void rd(string &x) {
x.clear();
char c;
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
do {
x += c;
if (pil == pir) load();
c = ibuf[pil++];
} while (!isspace(c));
}
template <typename T>
void rd_real(T &x) {
string s;
rd(s);
x = stod(s);
}
template <typename T>
void rd_integer(T &x) {
if (pil + 100 > pir) load();
char c;
do
c = ibuf[pil++];
while (c < '-');
bool minus = 0;
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (c == '-') { minus = 1, c = ibuf[pil++]; }
}
x = 0;
while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (minus) x = -x;
}
}
void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }
template <class T, class U>
void rd(pair<T, U> &p) {
return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
rd(x);
rd_tuple<N + 1>(t);
}
}
template <class... T>
void rd(tuple<T...> &tpl) {
rd_tuple(tpl);
}
template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
for (auto &d: x) rd(d);
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
rd(h), read(t...);
}
void wt(const char c) {
if (por == SZ) flush();
obuf[por++] = c;
}
void wt(const string s) {
for (char c: s) wt(c);
}
void wt(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) wt(s[i]);
}
template <typename T>
void wt_integer(T x) {
if (por > SZ - 100) flush();
if (x < 0) { obuf[por++] = '-', x = -x; }
int outi;
for (outi = 96; x >= 10000; outi -= 4) {
memcpy(out + outi, pre.num[x % 10000], 4);
x /= 10000;
}
if (x >= 1000) {
memcpy(obuf + por, pre.num[x], 4);
por += 4;
} else if (x >= 100) {
memcpy(obuf + por, pre.num[x] + 1, 3);
por += 3;
} else if (x >= 10) {
int q = (x * 103) >> 10;
obuf[por] = q | '0';
obuf[por + 1] = (x - q * 10) | '0';
por += 2;
} else
obuf[por++] = x | '0';
memcpy(obuf + por, out + outi + 4, 96 - outi);
por += 96 - outi;
}
template <typename T>
void wt_real(T x) {
ostringstream oss;
oss << fixed << setprecision(15) << double(x);
string s = oss.str();
wt(s);
}
void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }
template <class T, class U>
void wt(const pair<T, U> val) {
wt(val.first);
wt(' ');
wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { wt(' '); }
const auto x = std::get<N>(t);
wt(x);
wt_tuple<N + 1>(t);
}
}
template <class... T>
void wt(tuple<T...> tpl) {
wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
template <class T>
void wt(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
wt(head);
if (sizeof...(Tail)) wt(' ');
print(forward<Tail>(tail)...);
}
// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;
#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define U32(...) \
u32 __VA_ARGS__; \
read(__VA_ARGS__)
#define U64(...) \
u64 __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"
#line 2 "/home/maspy/compro/library/alg/monoid/min_idx.hpp"
template <typename T, bool tie_is_left = true>
struct Monoid_Min_Idx {
using value_type = pair<T, int>;
using X = value_type;
static constexpr bool is_small(const X& x, const X& y) {
if (x.fi < y.fi) return true;
if (x.fi > y.fi) return false;
return (tie_is_left ? (x.se < y.se) : (x.se >= y.se));
}
static X op(X x, X y) { return (is_small(x, y) ? x : y); }
static constexpr X unit() { return {infty<T>, -1}; }
static constexpr bool commute = true;
};
#line 2 "/home/maspy/compro/library/ds/segtree/segtree.hpp"
template <class Monoid>
struct SegTree {
using MX = Monoid;
using X = typename MX::value_type;
using value_type = X;
vc<X> dat;
int n, log, size;
SegTree() {}
SegTree(int n) { build(n); }
template <typename F>
SegTree(int n, F f) {
build(n, f);
}
SegTree(const vc<X>& v) { build(v); }
void build(int m) {
build(m, [](int i) -> X { return MX::unit(); });
}
void build(const vc<X>& v) {
build(len(v), [&](int i) -> X { return v[i]; });
}
template <typename F>
void build(int m, F f) {
n = m, log = 1;
while ((1 << log) < n) ++log;
size = 1 << log;
dat.assign(size << 1, MX::unit());
FOR(i, n) dat[size + i] = f(i);
FOR_R(i, 1, size) update(i);
}
X get(int i) { return dat[size + i]; }
vc<X> get_all() { return {dat.begin() + size, dat.begin() + size + n}; }
void update(int i) { dat[i] = Monoid::op(dat[2 * i], dat[2 * i + 1]); }
void set(int i, const X& x) {
assert(i < n);
dat[i += size] = x;
while (i >>= 1) update(i);
}
void multiply(int i, const X& x) {
assert(i < n);
i += size;
dat[i] = Monoid::op(dat[i], x);
while (i >>= 1) update(i);
}
X prod(int L, int R) {
assert(0 <= L && L <= R && R <= n);
X vl = Monoid::unit(), vr = Monoid::unit();
L += size, R += size;
while (L < R) {
if (L & 1) vl = Monoid::op(vl, dat[L++]);
if (R & 1) vr = Monoid::op(dat[--R], vr);
L >>= 1, R >>= 1;
}
return Monoid::op(vl, vr);
}
X prod_all() { return dat[1]; }
template <class F>
int max_right(F check, int L) {
assert(0 <= L && L <= n && check(Monoid::unit()));
if (L == n) return n;
L += size;
X sm = Monoid::unit();
do {
while (L % 2 == 0) L >>= 1;
if (!check(Monoid::op(sm, dat[L]))) {
while (L < size) {
L = 2 * L;
if (check(Monoid::op(sm, dat[L]))) { sm = Monoid::op(sm, dat[L++]); }
}
return L - size;
}
sm = Monoid::op(sm, dat[L++]);
} while ((L & -L) != L);
return n;
}
template <class F>
int min_left(F check, int R) {
assert(0 <= R && R <= n && check(Monoid::unit()));
if (R == 0) return 0;
R += size;
X sm = Monoid::unit();
do {
--R;
while (R > 1 && (R % 2)) R >>= 1;
if (!check(Monoid::op(dat[R], sm))) {
while (R < size) {
R = 2 * R + 1;
if (check(Monoid::op(dat[R], sm))) { sm = Monoid::op(dat[R--], sm); }
}
return R + 1 - size;
}
sm = Monoid::op(dat[R], sm);
} while ((R & -R) != R);
return 0;
}
// prod_{l<=i<r} A[i xor x]
X xor_prod(int l, int r, int xor_val) {
static_assert(Monoid::commute);
X x = Monoid::unit();
for (int k = 0; k < log + 1; ++k) {
if (l >= r) break;
if (l & 1) { x = Monoid::op(x, dat[(size >> k) + ((l++) ^ xor_val)]); }
if (r & 1) { x = Monoid::op(x, dat[(size >> k) + ((--r) ^ xor_val)]); }
l /= 2, r /= 2, xor_val /= 2;
}
return x;
}
};
#line 2 "/home/maspy/compro/library/random/base.hpp"
u64 RNG_64() {
static uint64_t x_
= uint64_t(chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count()) * 10150724397891781847ULL;
x_ ^= x_ << 7;
return x_ ^= x_ >> 9;
}
u64 RNG(u64 lim) { return RNG_64() % lim; }
ll RNG(ll l, ll r) { return l + RNG_64() % (r - l); }
#line 2 "/home/maspy/compro/library/mod/modint_common.hpp"
struct has_mod_impl {
template <class T>
static auto check(T &&x) -> decltype(x.get_mod(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_mod : public decltype(has_mod_impl::check<T>(std::declval<T>())) {};
template <typename mint>
mint inv(int n) {
static const int mod = mint::get_mod();
static vector<mint> dat = {0, 1};
assert(0 <= n);
if (n >= mod) n %= mod;
while (len(dat) <= n) {
int k = len(dat);
int q = (mod + k - 1) / k;
dat.eb(dat[k * q - mod] * mint::raw(q));
}
return dat[n];
}
template <typename mint>
mint fact(int n) {
static const int mod = mint::get_mod();
assert(0 <= n && n < mod);
static vector<mint> dat = {1, 1};
while (len(dat) <= n) dat.eb(dat[len(dat) - 1] * mint::raw(len(dat)));
return dat[n];
}
template <typename mint>
mint fact_inv(int n) {
static vector<mint> dat = {1, 1};
if (n < 0) return mint(0);
while (len(dat) <= n) dat.eb(dat[len(dat) - 1] * inv<mint>(len(dat)));
return dat[n];
}
template <class mint, class... Ts>
mint fact_invs(Ts... xs) {
return (mint(1) * ... * fact_inv<mint>(xs));
}
template <typename mint, class Head, class... Tail>
mint multinomial(Head &&head, Tail &&... tail) {
return fact<mint>(head) * fact_invs<mint>(std::forward<Tail>(tail)...);
}
template <typename mint>
mint C_dense(int n, int k) {
static vvc<mint> C;
static int H = 0, W = 0;
auto calc = [&](int i, int j) -> mint {
if (i == 0) return (j == 0 ? mint(1) : mint(0));
return C[i - 1][j] + (j ? C[i - 1][j - 1] : 0);
};
if (W <= k) {
FOR(i, H) {
C[i].resize(k + 1);
FOR(j, W, k + 1) { C[i][j] = calc(i, j); }
}
W = k + 1;
}
if (H <= n) {
C.resize(n + 1);
FOR(i, H, n + 1) {
C[i].resize(W);
FOR(j, W) { C[i][j] = calc(i, j); }
}
H = n + 1;
}
return C[n][k];
}
template <typename mint, bool large = false, bool dense = false>
mint C(ll n, ll k) {
assert(n >= 0);
if (k < 0 || n < k) return 0;
if constexpr (dense) return C_dense<mint>(n, k);
if constexpr (!large) return multinomial<mint>(n, k, n - k);
k = min(k, n - k);
mint x(1);
FOR(i, k) x *= mint(n - i);
return x * fact_inv<mint>(k);
}
template <typename mint, bool large = false>
mint C_inv(ll n, ll k) {
assert(n >= 0);
assert(0 <= k && k <= n);
if (!large) return fact_inv<mint>(n) * fact<mint>(k) * fact<mint>(n - k);
return mint(1) / C<mint, 1>(n, k);
}
// [x^d](1-x)^{-n}
template <typename mint, bool large = false, bool dense = false>
mint C_negative(ll n, ll d) {
assert(n >= 0);
if (d < 0) return mint(0);
if (n == 0) { return (d == 0 ? mint(1) : mint(0)); }
return C<mint, large, dense>(n + d - 1, d);
}
#line 3 "/home/maspy/compro/library/mod/modint.hpp"
template <int mod>
struct modint {
static constexpr u32 umod = u32(mod);
static_assert(umod < u32(1) << 31);
u32 val;
static modint raw(u32 v) {
modint x;
x.val = v;
return x;
}
constexpr modint() : val(0) {}
constexpr modint(u32 x) : val(x % umod) {}
constexpr modint(u64 x) : val(x % umod) {}
constexpr modint(u128 x) : val(x % umod) {}
constexpr modint(int x) : val((x %= mod) < 0 ? x + mod : x){};
constexpr modint(ll x) : val((x %= mod) < 0 ? x + mod : x){};
constexpr modint(i128 x) : val((x %= mod) < 0 ? x + mod : x){};
bool operator<(const modint &other) const { return val < other.val; }
modint &operator+=(const modint &p) {
if ((val += p.val) >= umod) val -= umod;
return *this;
}
modint &operator-=(const modint &p) {
if ((val += umod - p.val) >= umod) val -= umod;
return *this;
}
modint &operator*=(const modint &p) {
val = u64(val) * p.val % umod;
return *this;
}
modint &operator/=(const modint &p) {
*this *= p.inverse();
return *this;
}
modint operator-() const { return modint::raw(val ? mod - val : u32(0)); }
modint operator+(const modint &p) const { return modint(*this) += p; }
modint operator-(const modint &p) const { return modint(*this) -= p; }
modint operator*(const modint &p) const { return modint(*this) *= p; }
modint operator/(const modint &p) const { return modint(*this) /= p; }
bool operator==(const modint &p) const { return val == p.val; }
bool operator!=(const modint &p) const { return val != p.val; }
modint inverse() const {
int a = val, b = mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b), swap(u -= t * v, v);
}
return modint(u);
}
modint pow(ll n) const {
assert(n >= 0);
modint ret(1), mul(val);
while (n > 0) {
if (n & 1) ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
static constexpr int get_mod() { return mod; }
// (n, r), r は 1 の 2^n 乗根
static constexpr pair<int, int> ntt_info() {
if (mod == 120586241) return {20, 74066978};
if (mod == 167772161) return {25, 17};
if (mod == 469762049) return {26, 30};
if (mod == 754974721) return {24, 362};
if (mod == 880803841) return {23, 211};
if (mod == 943718401) return {22, 663003469};
if (mod == 998244353) return {23, 31};
if (mod == 1004535809) return {21, 836905998};
if (mod == 1045430273) return {20, 363};
if (mod == 1051721729) return {20, 330};
if (mod == 1053818881) return {20, 2789};
return {-1, -1};
}
static constexpr bool can_ntt() { return ntt_info().fi != -1; }
};
#ifdef FASTIO
template <int mod>
void rd(modint<mod> &x) {
fastio::rd(x.val);
x.val %= mod;
// assert(0 <= x.val && x.val < mod);
}
template <int mod>
void wt(modint<mod> x) {
fastio::wt(x.val);
}
#endif
using modint107 = modint<1000000007>;
using modint998 = modint<998244353>;
#line 2 "/home/maspy/compro/library/mod/modint61.hpp"
struct modint61 {
static constexpr u64 mod = (1ULL << 61) - 1;
u64 val;
constexpr modint61() : val(0ULL) {}
constexpr modint61(u32 x) : val(x) {}
constexpr modint61(u64 x) : val(x % mod) {}
constexpr modint61(int x) : val((x < 0) ? (x + static_cast<ll>(mod)) : x) {}
constexpr modint61(ll x) : val(((x %= static_cast<ll>(mod)) < 0) ? (x + static_cast<ll>(mod)) : x) {}
static constexpr u64 get_mod() { return mod; }
modint61 &operator+=(const modint61 &a) {
val = ((val += a.val) >= mod) ? (val - mod) : val;
return *this;
}
modint61 &operator-=(const modint61 &a) {
val = ((val -= a.val) >= mod) ? (val + mod) : val;
return *this;
}
modint61 &operator*=(const modint61 &a) {
const unsigned __int128 y = static_cast<unsigned __int128>(val) * a.val;
val = (y >> 61) + (y & mod);
val = (val >= mod) ? (val - mod) : val;
return *this;
}
modint61 operator-() const { return modint61(val ? mod - val : u64(0)); }
modint61 &operator/=(const modint61 &a) { return (*this *= a.inverse()); }
modint61 operator+(const modint61 &p) const { return modint61(*this) += p; }
modint61 operator-(const modint61 &p) const { return modint61(*this) -= p; }
modint61 operator*(const modint61 &p) const { return modint61(*this) *= p; }
modint61 operator/(const modint61 &p) const { return modint61(*this) /= p; }
bool operator<(const modint61 &other) const { return val < other.val; }
bool operator==(const modint61 &p) const { return val == p.val; }
bool operator!=(const modint61 &p) const { return val != p.val; }
modint61 inverse() const {
ll a = val, b = mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b), swap(u -= t * v, v);
}
return modint61(u);
}
modint61 pow(ll n) const {
assert(n >= 0);
modint61 ret(1), mul(val);
while (n > 0) {
if (n & 1) ret *= mul;
mul *= mul, n >>= 1;
}
return ret;
}
};
#ifdef FASTIO
void rd(modint61 &x) {
fastio::rd(x.val);
assert(0 <= x.val && x.val < modint61::mod);
}
void wt(modint61 x) { fastio::wt(x.val); }
#endif
#line 2 "/home/maspy/compro/library/ds/hashmap.hpp"
// u64 -> Val
template <typename Val>
struct HashMap {
// n は入れたいものの個数で ok
HashMap(u32 n = 0) { build(n); }
void build(u32 n) {
u32 k = 8;
while (k < n * 2) k *= 2;
cap = k / 2, mask = k - 1;
key.resize(k), val.resize(k), used.assign(k, 0);
}
// size を保ったまま. size=0 にするときは build すること.
void clear() {
used.assign(len(used), 0);
cap = (mask + 1) / 2;
}
int size() { return len(used) / 2 - cap; }
int index(const u64& k) {
int i = 0;
for (i = hash(k); used[i] && key[i] != k; i = (i + 1) & mask) {}
return i;
}
Val& operator[](const u64& k) {
if (cap == 0) extend();
int i = index(k);
if (!used[i]) { used[i] = 1, key[i] = k, val[i] = Val{}, --cap; }
return val[i];
}
Val get(const u64& k, Val default_value) {
int i = index(k);
return (used[i] ? val[i] : default_value);
}
bool count(const u64& k) {
int i = index(k);
return used[i] && key[i] == k;
}
// f(key, val)
template <typename F>
void enumerate_all(F f) {
FOR(i, len(used)) if (used[i]) f(key[i], val[i]);
}
private:
u32 cap, mask;
vc<u64> key;
vc<Val> val;
vc<bool> used;
u64 hash(u64 x) {
static const u64 FIXED_RANDOM = std::chrono::steady_clock::now().time_since_epoch().count();
x += FIXED_RANDOM;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return (x ^ (x >> 31)) & mask;
}
void extend() {
vc<pair<u64, Val>> dat;
dat.reserve(len(used) / 2 - cap);
FOR(i, len(used)) {
if (used[i]) dat.eb(key[i], val[i]);
}
build(2 * len(dat));
for (auto& [a, b]: dat) (*this)[a] = b;
}
};
#line 10 "main.cpp"
modint61 POW[100000];
using mint = modint998;
mint binom[20][20];
void init() {
modint61 base = RNG_64();
POW[0] = 1;
FOR(i, 100000 - 1) POW[i + 1] = POW[i] * base;
binom[0][0] = 1;
FOR(i, 19) FOR(j, i + 1) {
binom[i + 1][j] += binom[i][j];
binom[i + 1][j + 1] += binom[i][j];
}
}
struct Mono {
using value_type = pair<int, modint61>;
using X = value_type;
static X op(X L, X R) { return {L.fi + R.fi, L.se * POW[R.fi] + R.se}; }
static constexpr X unit() { return {0, 0}; }
static constexpr bool commute = 0;
};
void solve() {
LL(N, M, Q);
VEC(ll, A, N);
A.insert(A.begin(), 0);
auto f1 = [&](int i) -> pair<ll, int> { return {A[i] << 32 | RNG(0, infty<int>), i}; };
auto f2 = [&](int i) -> pair<int, modint61> { return {1, 1 + A[i]}; };
SegTree<Monoid_Min_Idx<ll>> seg1(N + 1, f1);
SegTree<Mono> seg2(N + 1, f2);
using ARR = array<mint, 16>;
HashMap<ARR> MP;
auto dfs = [&](auto& dfs, int L, int R) -> ARR {
u64 key = seg2.prod(L, R + 1).se.val;
key = 2 * key + (R == N);
if (MP.count(key)) return MP[key];
ARR dp{};
ll a = max(A[L], (R == N ? 0 : A[R]));
if (R == L + 1) {
dp[0] = max(a, A[R]) - a;
if (1 <= a) dp[1] = 1;
SHOW(L, R, dp);
return dp;
}
int idx = seg1.prod(L + 1, R).se;
ll b = A[idx];
auto X = dfs(dfs, L, idx);
auto Y = dfs(dfs, idx, R);
FOR(i, b + 1) FOR(j, b + 1) {
FOR(k, min(i, j) + 1) {
int p = i + j - 2 * k;
if (p > b) continue;
dp[p] += binom[b - p][k] * binom[p][i - k] * X[i] * Y[j];
}
}
ll ar = min(max(A[R], a), b);
ARR ndp{};
FOR(i, a + 1) FOR(j, ar - a + 1) { ndp[i] += binom[ar - a][j] * dp[i + j]; }
MP[key] = ndp;
// SHOW(L, R, ndp);
return ndp;
};
FOR(Q) {
INT(i, x);
A[i] = x;
seg1.set(i, f1(i));
seg2.set(i, f2(i));
auto dp = dfs(dfs, 0, N);
print(dp[0]);
}
}
signed main() {
init();
int T = 1;
// INT(T);
FOR(T) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 4492kb
input:
3 3 2 1 3 1 3 2 1 3
output:
5 14
result:
ok 2 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 4540kb
input:
6 8 1 3 8 7 7 1 6 1 4
output:
2100
result:
ok "2100"
Test #3:
score: 0
Accepted
time: 1ms
memory: 4516kb
input:
12 10 8 1 3 2 6 3 6 7 7 5 5 4 7 12 4 7 10 4 2 9 8 9 9 8 3 4 9 10 2
output:
2741280 3007680 1503840 1916160 1972800 728640 1821600 621440
result:
ok 8 tokens
Test #4:
score: 0
Accepted
time: 0ms
memory: 4864kb
input:
1939 5 1 5 1 1 2 1 5 4 5 3 1 2 1 3 3 1 2 3 5 5 3 2 2 1 3 1 5 1 4 2 5 4 1 5 4 3 4 5 3 3 3 3 2 1 2 3 5 1 4 2 1 4 1 3 5 2 2 1 4 4 5 3 2 3 2 1 1 5 5 5 5 3 4 3 1 3 1 1 1 3 5 3 5 1 5 4 3 2 1 2 2 2 3 5 2 4 2 3 1 2 5 5 1 2 5 2 5 3 3 3 4 5 1 5 4 5 3 3 5 4 5 3 5 3 2 2 5 3 2 4 3 3 4 2 2 1 3 1 3 5 2 3 4 2 3 2 4...
output:
894246250
result:
ok "894246250"
Test #5:
score: 0
Accepted
time: 1ms
memory: 4500kb
input:
245 9 1 2 2 3 6 7 5 7 4 7 9 7 6 3 1 6 8 2 1 1 5 3 1 1 3 1 6 8 4 8 4 8 1 8 6 6 9 3 4 7 1 5 2 3 9 5 7 5 7 7 5 5 5 5 1 5 4 7 1 2 6 8 9 5 4 1 8 6 3 9 9 1 3 6 5 5 5 1 6 5 1 2 5 5 4 1 1 8 3 8 2 9 7 9 5 7 8 8 5 9 1 1 4 4 9 9 6 3 9 8 9 2 1 2 6 9 2 1 3 7 3 2 5 9 3 7 2 2 3 4 7 5 1 8 5 8 6 7 9 7 4 8 7 2 2 7 5 ...
output:
99945033
result:
ok "99945033"
Test #6:
score: 0
Accepted
time: 2ms
memory: 4888kb
input:
1919 9 1 7 1 7 6 6 9 8 5 1 8 9 9 7 3 4 2 8 9 4 8 7 4 8 8 8 4 2 9 5 9 3 7 2 3 2 8 7 9 1 1 3 7 7 2 5 9 2 1 3 6 7 6 4 4 1 9 3 7 3 2 5 5 1 4 7 8 6 2 1 4 7 1 4 7 4 7 6 3 8 4 3 7 3 1 7 5 2 2 2 4 9 1 5 5 7 7 3 1 5 4 7 2 9 5 4 9 3 2 6 8 2 3 8 3 6 5 5 5 9 7 2 8 2 9 5 1 8 6 3 1 2 9 1 9 1 3 9 6 7 2 3 2 2 7 9 7...
output:
292474819
result:
ok "292474819"
Test #7:
score: 0
Accepted
time: 0ms
memory: 5048kb
input:
1985 5 1 1 5 5 1 4 4 3 2 1 4 4 1 1 2 5 5 5 3 3 1 2 4 3 3 5 5 2 4 1 1 5 4 3 1 2 5 5 4 1 5 2 5 2 4 1 4 5 1 3 4 4 2 2 4 5 2 1 5 5 3 2 5 5 2 4 4 5 2 5 1 1 5 5 1 1 3 4 2 4 5 2 1 2 1 1 2 3 5 1 5 2 4 1 5 3 2 2 3 1 3 4 5 1 4 4 2 4 3 5 5 1 4 3 4 5 5 2 5 2 2 2 2 2 3 5 1 4 4 3 3 4 5 5 4 3 5 1 4 5 5 2 3 2 2 3 3...
output:
810807913
result:
ok "810807913"
Test #8:
score: 0
Accepted
time: 1ms
memory: 4632kb
input:
357 5 1 1 3 2 5 4 4 3 4 3 1 1 1 4 5 5 2 1 3 4 1 3 1 2 3 4 1 5 3 1 3 5 1 4 4 2 4 5 1 3 4 2 5 2 3 2 5 3 2 2 1 4 3 1 1 2 3 2 3 2 1 4 4 5 5 1 4 2 1 2 2 2 4 1 3 5 1 1 2 4 4 5 4 1 2 4 1 2 3 2 4 3 4 3 4 1 4 1 1 4 5 4 4 4 3 2 5 4 5 4 2 4 1 2 5 5 3 5 5 2 4 2 1 2 1 4 1 2 1 3 1 5 2 2 1 5 2 2 4 5 1 3 4 5 3 3 3 ...
output:
836628563
result:
ok "836628563"
Test #9:
score: 0
Accepted
time: 2ms
memory: 4628kb
input:
858 10 1 1 9 2 9 6 9 6 10 9 4 1 9 7 7 9 2 5 6 9 3 4 7 4 2 5 10 8 10 4 8 8 1 2 9 10 9 5 9 1 2 1 8 10 2 8 1 10 6 9 5 2 4 9 4 1 5 6 10 7 5 1 7 6 7 9 8 4 4 1 8 1 4 4 10 8 10 1 1 1 2 6 3 6 9 8 10 4 5 8 3 6 7 2 9 9 7 9 10 5 7 4 9 4 7 3 1 10 2 6 4 1 5 8 7 1 6 1 2 8 8 1 3 6 8 5 3 10 9 8 4 8 5 2 2 2 10 8 1 8...
output:
699591879
result:
ok "699591879"
Test #10:
score: 0
Accepted
time: 1ms
memory: 4748kb
input:
884 7 1 7 2 6 7 1 7 2 5 5 1 7 5 4 5 2 5 4 2 2 4 3 2 7 1 6 3 3 2 1 1 2 1 7 7 4 3 5 1 1 6 6 7 5 1 6 6 4 3 5 2 3 1 6 3 7 2 7 4 6 6 6 3 7 6 1 3 2 1 1 5 4 3 1 4 4 4 7 2 5 7 5 7 5 3 6 5 5 1 4 5 6 6 6 3 6 7 3 2 3 1 5 5 6 7 6 5 3 2 7 3 1 2 5 5 1 2 7 5 3 1 3 6 4 7 2 4 4 5 6 7 4 7 4 2 4 1 2 1 2 6 7 1 7 4 1 1 ...
output:
298342150
result:
ok "298342150"
Test #11:
score: 0
Accepted
time: 2ms
memory: 4856kb
input:
2000 10 1 7 2 5 8 9 1 9 9 5 4 3 3 9 7 3 2 1 9 9 6 4 9 10 10 1 1 2 4 6 7 9 9 5 5 8 1 3 9 5 2 5 7 10 8 5 10 1 9 8 10 2 1 9 4 1 10 8 3 10 4 4 7 5 6 6 1 4 4 4 6 5 10 5 7 7 9 2 3 9 4 8 8 9 9 4 6 5 9 5 4 3 10 3 5 7 5 9 8 1 9 2 9 4 3 3 4 6 3 1 5 2 10 2 2 3 4 5 2 4 6 2 9 5 10 5 2 9 4 9 8 8 7 5 7 3 10 2 6 6 ...
output:
593281642
result:
ok "593281642"
Test #12:
score: 0
Accepted
time: 2ms
memory: 5052kb
input:
2000 10 1 4 3 9 2 9 3 9 2 7 1 4 10 1 10 8 10 1 6 9 5 7 5 10 10 1 10 5 7 1 5 5 8 10 10 4 10 6 6 1 9 8 5 2 3 5 3 1 1 3 3 6 2 6 9 8 4 10 8 7 8 9 10 5 3 6 3 2 4 10 1 10 8 7 10 7 1 4 3 2 8 8 7 7 9 1 7 5 3 5 7 6 6 9 8 8 8 9 7 10 8 3 5 5 1 3 10 9 1 9 2 10 9 3 1 6 1 7 10 9 9 9 3 6 9 2 10 6 1 5 2 2 5 6 6 9 1...
output:
635535966
result:
ok "635535966"
Test #13:
score: 0
Accepted
time: 2ms
memory: 5044kb
input:
2000 10 1 7 6 2 4 9 3 2 10 6 2 3 2 8 7 4 1 6 7 1 10 4 9 7 2 5 2 5 10 6 6 5 3 7 4 10 6 4 8 7 9 6 10 10 3 10 4 3 6 6 6 8 5 6 4 3 9 2 9 8 5 6 5 5 4 9 7 6 1 7 1 8 10 3 1 10 3 4 4 9 10 10 7 8 4 4 6 9 3 6 3 4 4 3 4 7 1 6 2 6 4 9 10 4 2 7 7 10 4 4 1 10 2 8 6 8 2 8 1 4 10 3 6 1 1 7 9 3 9 6 2 3 9 8 3 7 9 3 8...
output:
336713065
result:
ok "336713065"
Test #14:
score: 0
Accepted
time: 2ms
memory: 4868kb
input:
2000 10 1 10 10 2 4 8 7 8 9 8 7 5 10 8 2 5 5 1 3 10 5 4 3 6 3 9 9 10 9 9 9 6 10 6 2 9 3 7 4 7 10 2 4 7 3 9 3 7 10 5 9 10 7 8 1 7 7 9 10 6 4 10 4 3 6 10 5 4 7 5 6 8 8 1 6 5 7 7 5 4 2 5 8 5 9 9 9 7 10 2 9 7 6 1 8 9 2 4 1 9 8 7 9 4 2 3 2 3 2 7 5 4 8 8 2 4 8 6 4 1 3 3 9 7 10 7 7 3 8 1 1 4 2 3 4 10 8 8 8...
output:
85227947
result:
ok "85227947"
Test #15:
score: 0
Accepted
time: 2ms
memory: 4736kb
input:
2000 10 1 1 7 2 8 1 9 7 7 6 2 4 2 1 5 2 6 1 10 2 8 5 1 6 8 5 9 10 5 8 2 1 2 8 6 2 3 7 9 10 10 10 9 9 3 6 1 7 8 4 8 9 7 9 5 1 3 8 1 3 4 1 6 6 5 9 6 7 8 10 10 4 9 5 6 10 7 2 3 4 7 3 8 6 3 5 2 2 9 9 5 8 3 6 8 2 1 4 3 4 2 3 9 6 4 5 6 8 1 2 1 3 10 4 5 7 2 9 4 10 6 1 6 1 2 10 2 3 9 5 9 1 6 10 2 8 6 10 6 1...
output:
913697441
result:
ok "913697441"
Test #16:
score: 0
Accepted
time: 0ms
memory: 4832kb
input:
2000 10 1 7 9 2 6 9 1 10 1 8 3 4 5 1 10 6 10 4 10 3 1 10 2 10 8 3 5 2 2 4 9 5 7 2 4 8 5 7 5 1 10 8 10 5 8 10 4 2 9 8 9 6 3 7 10 1 7 6 9 4 10 8 5 1 3 5 7 3 6 3 2 8 5 6 2 8 2 7 6 1 6 7 4 3 5 8 3 8 9 5 6 2 8 2 4 5 2 4 1 3 9 7 1 5 9 9 2 3 2 1 8 6 1 3 6 7 3 5 5 8 3 9 5 9 1 7 2 3 5 1 7 8 10 3 4 10 8 3 6 8...
output:
298067446
result:
ok "298067446"
Test #17:
score: 0
Accepted
time: 2ms
memory: 4852kb
input:
2000 10 1 3 6 1 8 2 3 8 7 9 8 8 5 3 4 4 2 9 1 2 4 7 3 3 3 2 3 9 9 4 4 1 1 1 2 2 4 3 7 8 2 2 1 9 2 7 10 9 5 10 8 1 8 6 2 4 9 2 7 8 2 2 1 1 8 10 8 7 7 1 5 2 4 9 3 2 1 7 1 1 6 1 7 1 7 6 9 6 1 2 3 6 10 3 10 3 2 6 7 10 6 2 6 2 6 7 2 2 7 2 1 6 5 10 5 2 2 10 4 1 9 8 8 7 6 1 9 2 4 1 4 5 7 5 3 10 4 9 5 2 8 8...
output:
307824286
result:
ok "307824286"
Test #18:
score: 0
Accepted
time: 0ms
memory: 4548kb
input:
2000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
1
result:
ok "1"
Test #19:
score: 0
Accepted
time: 1ms
memory: 4368kb
input:
1 1 1 1 1 1
output:
1
result:
ok "1"
Test #20:
score: 0
Accepted
time: 0ms
memory: 4596kb
input:
2000 10 1 9 10 10 10 10 9 10 9 9 10 10 9 9 10 9 10 10 10 10 10 10 9 9 10 10 9 10 10 9 10 9 10 10 10 10 9 10 10 9 10 10 10 9 10 9 10 9 9 9 10 9 10 9 10 10 9 9 10 10 9 10 10 10 10 10 9 9 10 9 10 10 9 9 10 9 9 10 9 10 10 9 9 9 10 9 10 10 9 10 10 9 9 10 10 10 10 9 10 10 10 9 9 9 10 10 9 9 10 9 10 10 10 ...
output:
214050412
result:
ok "214050412"
Test #21:
score: 0
Accepted
time: 1ms
memory: 4652kb
input:
2000 10 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
output:
527357103
result:
ok "527357103"
Test #22:
score: 0
Accepted
time: 1ms
memory: 4820kb
input:
2000 10 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
output:
106236082
result:
ok "106236082"
Test #23:
score: 0
Accepted
time: 0ms
memory: 5324kb
input:
5484 3 1 1 3 1 3 3 1 1 2 3 1 3 3 3 3 3 2 2 3 1 3 3 2 1 3 3 1 2 2 2 3 2 2 3 2 3 2 1 2 1 1 1 1 2 2 3 1 1 3 3 1 3 1 1 2 2 2 3 1 3 1 3 2 1 3 1 3 2 1 3 1 1 1 3 1 3 1 2 2 1 2 2 1 3 3 3 2 3 1 2 1 1 3 1 1 1 2 2 1 3 2 3 2 3 1 3 2 2 2 3 1 3 2 2 2 3 2 3 1 2 3 1 1 1 3 3 3 2 3 3 3 3 2 2 1 3 1 1 1 2 1 2 2 1 1 2 3...
output:
886224409
result:
ok "886224409"
Test #24:
score: 0
Accepted
time: 7ms
memory: 7372kb
input:
8556 12 1 10 4 12 5 11 12 11 6 10 7 3 10 4 1 6 3 5 4 6 3 10 12 10 6 9 9 1 9 11 6 12 11 5 8 3 1 11 12 7 1 4 6 3 6 8 8 12 8 9 3 8 7 2 2 5 5 4 1 9 8 7 3 1 5 9 10 5 6 10 6 7 6 10 1 10 2 4 9 12 6 2 6 7 8 9 7 3 12 6 5 12 5 9 3 5 3 7 7 8 6 11 10 8 10 4 3 5 2 7 3 5 7 8 6 2 2 11 12 4 12 10 10 10 6 4 5 1 7 6 ...
output:
835287489
result:
ok "835287489"
Test #25:
score: 0
Accepted
time: 23ms
memory: 14492kb
input:
29076 14 1 14 12 7 10 5 11 7 12 1 14 2 7 12 1 14 13 9 10 13 1 14 2 10 11 5 4 8 13 8 1 5 9 5 10 1 4 9 13 10 9 12 6 7 2 14 13 11 3 6 6 4 6 11 1 2 12 6 1 12 1 3 8 6 6 3 11 4 10 2 10 11 2 5 11 13 14 12 11 2 9 4 12 3 4 2 2 14 2 10 8 11 4 5 11 2 7 11 1 9 13 2 2 12 10 5 4 5 4 4 9 9 2 7 13 12 2 14 6 12 3 4 ...
output:
428714926
result:
ok "428714926"
Test #26:
score: 0
Accepted
time: 4ms
memory: 10464kb
input:
21530 8 1 5 1 1 7 2 2 4 1 1 6 3 3 4 8 1 8 3 8 6 6 2 6 7 4 8 8 4 5 2 1 4 2 4 7 7 8 7 1 5 1 1 2 8 3 4 3 8 1 4 4 4 2 5 3 3 3 8 1 5 7 8 7 6 1 6 4 3 7 7 4 6 8 3 1 2 8 1 6 1 6 6 1 1 4 7 1 4 5 4 1 4 7 1 6 2 6 6 2 1 6 1 4 3 1 7 4 4 6 8 3 8 8 8 4 2 2 3 5 3 3 7 8 4 6 3 1 4 7 7 2 5 1 4 5 2 7 7 7 4 1 5 6 5 6 8 ...
output:
682167889
result:
ok "682167889"
Test #27:
score: 0
Accepted
time: 3ms
memory: 5708kb
input:
6134 7 1 6 7 4 4 2 2 5 2 2 3 3 1 5 4 5 6 7 6 7 2 1 1 5 3 1 6 2 2 6 2 5 2 1 2 4 7 5 2 6 1 5 5 1 6 1 3 3 3 5 5 3 7 3 6 2 3 5 3 3 4 6 2 3 4 3 1 3 3 7 1 5 6 2 7 3 7 4 7 7 4 2 2 3 6 1 1 7 1 3 4 5 3 6 4 2 7 4 6 2 1 5 7 1 5 3 5 7 1 7 3 2 1 5 7 6 4 1 7 6 1 7 7 3 1 1 3 1 4 5 5 7 4 5 4 2 1 2 2 3 1 2 4 2 6 1 6...
output:
479862425
result:
ok "479862425"
Test #28:
score: 0
Accepted
time: 4ms
memory: 5520kb
input:
5712 9 1 1 3 9 3 2 9 8 7 4 5 1 2 1 1 3 9 9 5 2 1 9 2 4 5 3 9 9 6 3 1 5 5 2 5 2 8 2 2 1 9 8 5 2 8 6 5 3 3 9 9 6 5 6 7 1 2 3 4 4 5 3 6 6 6 6 2 8 5 3 7 2 5 3 9 6 4 7 2 6 5 1 2 4 3 3 5 9 3 9 6 9 5 4 6 2 4 7 8 3 1 9 7 4 8 1 7 1 7 1 3 8 6 2 4 1 7 6 3 2 3 1 8 6 4 1 6 6 8 7 6 3 5 1 2 7 4 6 5 8 3 2 3 7 7 9 3...
output:
800069213
result:
ok "800069213"
Test #29:
score: 0
Accepted
time: 8ms
memory: 9232kb
input:
13882 10 1 3 7 7 2 9 8 8 8 2 10 4 9 8 2 2 10 6 7 9 9 9 2 1 7 8 3 1 6 3 5 5 4 10 6 7 1 9 4 7 5 6 10 5 3 3 5 1 4 8 5 9 10 4 4 9 3 6 7 2 9 7 4 4 4 7 9 2 2 1 8 6 8 7 6 6 6 6 2 8 4 10 8 4 9 5 10 6 4 5 1 8 9 7 3 10 3 4 2 10 4 5 9 4 5 4 2 4 2 9 7 6 3 2 3 5 4 5 1 9 4 9 8 4 5 9 8 8 7 8 9 2 5 3 8 10 8 8 7 7 1...
output:
840192715
result:
ok "840192715"
Test #30:
score: 0
Accepted
time: 27ms
memory: 14560kb
input:
30000 15 1 7 14 1 2 8 11 12 11 15 9 6 2 12 12 15 1 4 5 12 9 5 8 5 11 13 6 2 5 12 10 14 3 8 9 12 11 4 7 5 15 9 2 11 15 11 14 11 15 15 1 1 11 11 1 9 6 4 14 9 6 14 8 6 1 7 7 10 5 8 7 5 7 9 3 5 6 3 11 13 2 14 14 5 10 12 14 6 10 9 13 13 10 6 15 7 15 1 6 15 8 1 13 2 15 13 5 10 8 14 9 1 12 3 8 10 15 2 6 6 ...
output:
930560461
result:
ok "930560461"
Test #31:
score: 0
Accepted
time: 20ms
memory: 14524kb
input:
30000 15 1 11 5 10 8 7 7 3 11 9 13 14 7 12 7 2 8 14 6 6 5 12 13 4 2 2 12 14 10 8 14 12 10 6 11 6 15 3 5 15 15 11 15 9 6 4 3 13 4 1 14 7 10 6 15 6 8 15 15 10 3 7 9 7 6 14 14 11 5 11 5 11 13 12 7 6 12 3 1 15 2 10 8 7 15 10 1 2 13 9 1 9 6 3 4 4 5 2 1 4 7 6 14 2 5 3 2 4 8 4 6 12 14 9 2 15 15 13 4 5 5 12...
output:
486842491
result:
ok "486842491"
Test #32:
score: 0
Accepted
time: 23ms
memory: 14600kb
input:
30000 15 1 14 15 10 14 13 2 12 13 6 8 7 15 2 6 8 15 10 3 5 3 5 11 8 12 5 9 12 13 4 13 1 5 2 12 3 14 15 6 13 9 13 5 15 2 14 13 6 3 12 14 6 15 1 14 3 1 5 13 11 5 13 8 13 12 13 10 10 6 1 10 1 1 9 11 1 10 12 4 12 8 11 13 10 12 15 3 6 3 14 10 1 15 7 13 15 3 8 5 11 7 6 13 10 3 2 10 2 13 12 9 7 2 12 11 9 4...
output:
50307243
result:
ok "50307243"
Test #33:
score: 0
Accepted
time: 24ms
memory: 14684kb
input:
30000 15 1 1 14 14 11 14 13 4 13 12 10 8 3 3 10 11 6 9 8 4 5 4 10 9 6 4 6 9 5 14 4 10 12 2 4 15 2 8 3 12 7 4 13 14 6 9 9 4 11 7 14 4 13 8 7 11 9 14 15 5 1 3 15 5 15 1 8 4 4 15 6 1 4 6 14 1 7 5 11 5 4 3 7 7 11 3 8 11 3 6 8 11 8 3 1 9 11 7 6 14 6 8 11 1 7 15 8 14 9 15 5 11 3 11 12 6 2 4 2 13 12 14 3 7...
output:
630828146
result:
ok "630828146"
Test #34:
score: 0
Accepted
time: 24ms
memory: 14500kb
input:
30000 15 1 7 7 11 14 7 10 7 6 10 9 12 2 2 8 11 10 15 12 2 8 11 13 8 9 14 10 4 3 4 10 9 11 3 6 6 13 6 11 7 11 8 10 9 1 9 7 14 1 6 8 10 13 11 10 14 13 2 13 4 13 15 5 8 2 2 1 10 1 10 13 3 7 14 11 4 4 6 5 5 6 15 3 7 14 6 13 11 2 1 6 15 7 7 5 5 9 13 6 15 6 5 10 3 13 4 15 10 1 15 12 5 11 12 7 2 3 3 8 7 15...
output:
953149809
result:
ok "953149809"
Test #35:
score: 0
Accepted
time: 20ms
memory: 14636kb
input:
30000 15 1 14 13 9 7 2 8 9 2 6 1 10 6 3 4 8 15 12 6 15 9 12 9 11 5 4 4 12 2 10 7 12 5 14 10 4 9 7 7 8 3 2 7 5 1 1 9 1 9 11 13 12 9 8 14 12 14 3 13 5 1 1 9 12 9 13 12 2 1 12 1 1 7 7 10 2 13 11 3 10 15 15 12 1 13 9 2 3 3 1 12 5 5 11 15 15 5 12 12 4 13 5 5 4 2 2 3 9 10 6 5 8 4 1 1 14 6 4 14 8 8 3 15 12...
output:
54181826
result:
ok "54181826"
Test #36:
score: 0
Accepted
time: 23ms
memory: 14412kb
input:
30000 15 1 13 2 6 13 3 1 15 9 4 13 11 14 13 5 3 15 3 12 2 12 11 2 3 13 5 8 2 4 9 11 14 14 8 1 1 7 1 15 4 4 12 13 7 1 11 10 15 6 14 5 4 15 5 8 9 6 14 15 3 3 15 11 10 3 12 3 7 2 8 3 7 2 9 5 4 8 5 14 11 2 7 11 6 11 6 11 14 1 15 1 1 15 5 15 7 5 11 1 3 5 8 11 1 11 4 10 4 10 6 15 1 12 5 10 12 13 15 7 8 6 ...
output:
415874796
result:
ok "415874796"
Test #37:
score: 0
Accepted
time: 2ms
memory: 6520kb
input:
30000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1
result:
ok "1"
Test #38:
score: 0
Accepted
time: 27ms
memory: 8428kb
input:
30000 15 1 14 15 15 15 15 15 14 14 14 15 15 15 14 14 14 15 15 14 15 15 15 15 14 15 15 15 14 15 14 15 14 14 15 14 14 14 14 14 15 14 14 15 14 14 14 15 14 14 15 14 15 15 15 15 15 14 15 15 15 14 15 15 14 15 14 15 15 15 15 15 15 14 15 14 14 14 15 15 15 14 14 15 14 15 14 15 14 14 15 14 15 14 15 14 14 14 1...
output:
886986198
result:
ok "886986198"
Test #39:
score: 0
Accepted
time: 27ms
memory: 8416kb
input:
30000 15 1 15 15 15 14 14 15 15 14 14 14 14 15 14 15 14 15 15 14 14 14 14 15 14 15 14 14 14 14 15 15 15 14 14 14 15 15 15 15 15 15 15 15 14 14 15 14 15 15 14 14 14 14 15 15 14 15 14 15 15 15 14 15 15 15 14 15 14 15 14 15 14 14 14 15 15 14 14 15 14 15 14 14 14 14 14 14 15 14 15 15 15 14 15 15 14 15 1...
output:
668247064
result:
ok "668247064"
Test #40:
score: 0
Accepted
time: 19ms
memory: 8396kb
input:
30000 15 1 15 14 15 14 15 15 15 14 14 14 15 14 15 15 14 14 15 14 15 15 15 14 15 15 14 14 14 14 15 15 14 14 15 15 15 14 15 15 15 15 15 14 14 15 14 14 14 14 15 15 15 14 14 14 14 14 14 15 14 14 14 14 14 15 15 14 15 15 15 14 14 15 15 15 14 14 15 14 15 14 15 14 15 15 15 15 15 15 14 15 15 14 15 14 14 15 1...
output:
562849724
result:
ok "562849724"
Test #41:
score: 0
Accepted
time: 4ms
memory: 6612kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
673429076
result:
ok "673429076"
Test #42:
score: 0
Accepted
time: 2ms
memory: 6468kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
516022986
result:
ok "516022986"
Test #43:
score: 0
Accepted
time: 5ms
memory: 8516kb
input:
30000 15 1 1 15 1 15 1 1 1 15 1 1 15 15 15 1 1 15 15 15 1 1 1 1 15 1 15 15 1 1 15 1 1 1 1 1 1 15 1 15 15 1 15 15 15 1 1 15 1 1 1 15 15 15 1 1 1 1 1 15 15 1 1 1 15 1 1 15 15 15 15 1 1 15 1 1 1 1 15 15 15 15 15 1 15 15 1 1 15 1 1 15 15 1 15 15 15 1 15 1 1 15 15 15 15 1 15 1 1 15 1 15 1 15 1 1 1 15 1 1...
output:
115103138
result:
ok "115103138"
Test #44:
score: 0
Accepted
time: 0ms
memory: 8384kb
input:
30000 15 1 15 1 15 15 1 15 15 15 15 1 15 1 1 1 15 15 15 1 1 1 1 1 1 15 15 15 1 1 1 15 15 15 15 1 1 15 1 15 1 15 1 1 15 15 15 1 1 1 1 1 1 1 1 1 15 15 1 15 1 15 15 1 15 1 1 1 1 1 15 15 15 1 15 15 15 15 1 15 1 1 15 15 1 15 15 15 1 15 15 15 15 1 1 1 1 15 1 15 1 15 1 15 1 15 15 15 1 15 15 1 15 1 1 1 1 1 ...
output:
777366768
result:
ok "777366768"
Test #45:
score: 0
Accepted
time: 0ms
memory: 8312kb
input:
30000 15 1 1 1 15 1 1 15 1 15 1 1 15 15 1 1 1 1 15 1 1 1 15 15 15 15 1 15 1 1 15 1 1 1 15 15 15 1 15 15 1 1 15 1 15 15 1 1 15 15 15 1 1 1 1 15 1 1 1 15 15 15 1 15 15 15 1 1 15 1 15 1 1 1 1 15 1 15 15 1 1 1 1 1 15 1 1 15 15 1 15 1 1 15 15 1 15 15 1 1 1 1 1 1 15 15 15 1 1 15 1 15 15 15 1 1 15 15 1 15 ...
output:
879322138
result:
ok "879322138"
Test #46:
score: 0
Accepted
time: 4ms
memory: 6576kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
354391629
result:
ok "354391629"
Test #47:
score: 0
Accepted
time: 5ms
memory: 6896kb
input:
30000 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
666493861
result:
ok "666493861"
Test #48:
score: 0
Accepted
time: 2ms
memory: 6348kb
input:
30000 15 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1...
output:
640857910
result:
ok "640857910"
Test #49:
score: 0
Accepted
time: 0ms
memory: 6476kb
input:
30000 15 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1...
output:
370646039
result:
ok "370646039"
Test #50:
score: 0
Accepted
time: 4ms
memory: 6916kb
input:
30000 15 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...
output:
553300345
result:
ok "553300345"
Test #51:
score: 0
Accepted
time: 87ms
memory: 72872kb
input:
23069 10 12025 4 2 8 7 5 4 10 6 5 10 1 10 1 4 4 10 5 7 7 3 5 5 7 4 7 2 6 8 9 2 7 8 2 7 3 7 9 5 10 2 5 10 9 10 8 10 9 3 4 1 4 6 5 5 10 7 1 7 2 8 2 3 8 8 10 9 9 4 1 3 7 5 1 1 4 7 3 6 9 8 7 6 1 7 8 1 7 9 9 8 3 4 8 6 4 8 8 8 7 1 1 5 5 10 9 1 8 8 5 10 9 2 3 10 9 2 7 8 10 5 10 10 8 6 7 8 6 8 9 5 6 1 10 10...
output:
968505026 55485091 361959346 283015680 679237632 483478779 307144355 11544202 502008227 137763897 982935997 27264320 127349300 99734190 670547928 841455638 841455638 301643587 83331998 691289897 731349157 61957510 947528086 947528086 675446634 225148878 288646400 742863125 381490210 381490210 469827...
result:
ok 12025 tokens
Test #52:
score: 0
Accepted
time: 152ms
memory: 139732kb
input:
23602 8 25014 1 8 2 8 2 6 5 4 5 7 1 7 5 1 1 7 5 1 7 5 1 2 2 3 7 2 6 7 7 3 3 5 4 2 5 2 1 5 6 2 6 8 3 8 7 3 2 1 1 7 1 6 2 1 2 2 4 1 4 2 8 6 1 4 5 4 6 3 7 4 7 5 8 2 6 4 5 3 2 3 2 6 2 1 1 2 6 7 3 5 3 1 6 5 1 4 8 8 4 2 4 4 2 6 5 2 4 2 7 1 5 1 5 5 5 3 4 6 5 7 4 8 1 8 2 1 8 2 1 2 1 1 6 8 2 7 1 5 3 1 1 2 2 ...
output:
541177119 162234248 440904283 440904283 579266741 971024033 656440670 656440670 925808612 104007635 778759007 559638022 39631014 252123373 106588833 786024463 450259677 62557367 636807778 642532807 989365725 69307623 348298986 464398648 464398648 766281407 791933041 922191335 51856525 51856525 51856...
result:
ok 25014 tokens
Test #53:
score: 0
Accepted
time: 185ms
memory: 139568kb
input:
25107 7 28960 1 5 1 1 6 1 1 6 2 6 5 5 7 1 7 5 4 2 3 2 5 2 1 4 4 1 2 1 3 7 7 4 7 6 6 7 2 4 5 3 3 5 1 3 6 5 2 4 3 2 5 3 5 5 7 2 6 2 6 2 5 3 6 6 7 2 7 5 6 2 6 4 6 4 2 6 4 4 5 1 3 5 5 3 5 3 2 4 1 4 4 1 5 3 7 1 6 3 4 1 5 3 2 7 2 4 2 4 6 4 4 2 2 5 1 4 7 7 2 4 3 5 1 5 5 6 7 6 6 6 4 3 1 2 7 2 3 5 7 1 4 6 6 ...
output:
199053210 516843380 93977920 994981348 442686656 623060698 732931746 589908424 84272632 951269247 416915741 492718603 859538916 104801350 104801350 864382357 205550713 106464008 99814418 199959150 341431732 341431732 934166748 281772142 976679351 447471840 34027970 897467716 119027561 756889039 7680...
result:
ok 28960 tokens
Test #54:
score: 0
Accepted
time: 40ms
memory: 38524kb
input:
13962 13 3707 4 6 12 5 13 11 7 10 1 7 10 2 3 10 3 13 8 5 12 13 4 9 1 13 8 4 7 1 6 12 13 1 13 10 10 6 9 2 9 9 4 3 10 12 3 4 9 10 6 4 7 9 7 10 3 1 3 1 11 13 7 11 2 13 2 10 5 5 11 1 11 13 9 6 8 8 4 4 1 11 7 7 13 1 9 8 7 13 7 6 6 9 4 7 10 12 9 2 10 8 3 12 5 5 12 8 5 2 5 11 10 7 6 2 4 9 3 3 9 8 4 11 3 7 ...
output:
276109416 840238204 694858458 664652304 286153540 666015604 443262601 575437164 359340320 157504118 352213706 58396765 546877234 614428039 609590093 795973112 178492641 825384521 941188876 714749531 548944676 548944676 364923716 729847432 591148054 978781901 736900663 736900663 692684825 647423253 9...
result:
ok 3707 tokens
Test #55:
score: 0
Accepted
time: 119ms
memory: 72780kb
input:
18584 13 14364 10 11 4 10 8 10 10 8 9 3 11 9 9 7 4 8 4 12 10 8 10 12 2 13 2 4 7 12 10 3 10 4 6 5 9 8 11 4 2 6 8 7 1 4 13 8 11 11 4 2 2 12 2 4 8 1 13 6 4 7 10 11 3 7 10 12 9 1 3 10 12 5 10 7 11 3 10 13 2 10 4 6 11 8 7 8 2 5 10 7 7 1 1 5 12 10 7 5 3 2 8 4 12 2 4 11 12 5 9 2 4 5 3 11 13 7 1 9 5 13 1 1 ...
output:
658709022 497231145 871575369 258501464 499540539 482627339 341365782 144778896 808883262 565147088 113575925 728645018 388249791 312547060 94372671 50816229 816496597 891308538 261249127 639631151 291100596 941452278 323552752 278537075 90711667 930283262 258822286 674851472 792959367 968689642 704...
result:
ok 14364 tokens
Test #56:
score: 0
Accepted
time: 87ms
memory: 72740kb
input:
28547 12 10076 5 3 11 6 10 3 1 6 12 12 2 10 4 1 1 1 11 5 11 7 7 12 4 10 5 7 6 6 10 2 7 6 8 7 7 9 10 10 8 9 11 5 4 12 9 9 11 8 11 7 10 11 4 8 8 7 10 11 9 4 4 9 9 4 3 12 11 10 6 8 9 3 4 10 2 3 9 4 9 11 10 1 9 10 4 12 8 12 6 4 4 1 1 3 7 6 11 2 12 4 12 4 1 5 2 6 10 4 5 2 7 3 7 10 10 4 9 2 8 10 9 6 7 3 5...
output:
885664536 885664536 23889076 456414884 456414884 539163546 952326779 952326779 193910068 715078137 893170269 377884337 361564758 212928322 959212520 746410474 704821236 759627885 3694311 740124339 46628499 338179891 242514922 255559380 64018819 308244426 877375429 756506505 956562987 956562987 89896...
result:
ok 10076 tokens
Test #57:
score: 0
Accepted
time: 22ms
memory: 37764kb
input:
1407 3 8746 2 3 1 2 3 1 1 3 2 2 3 3 1 2 3 2 2 3 3 1 2 3 3 3 2 3 1 1 1 1 3 2 1 1 1 3 1 2 3 1 2 3 1 2 2 2 1 2 2 2 2 1 2 3 1 3 2 1 1 2 2 1 3 2 2 2 2 2 1 2 3 1 3 1 3 2 3 2 2 3 3 3 1 3 1 3 2 1 1 2 2 2 2 2 2 2 2 1 2 3 2 2 3 3 1 2 2 3 1 3 3 1 1 3 3 1 2 2 1 3 3 1 2 3 3 1 3 3 3 1 1 1 3 3 1 3 2 2 3 3 2 2 2 1 ...
output:
523300148 523300148 48355943 523300148 48355943 523300148 784950222 784950222 784950222 784950222 71672392 71672392 71672392 71672392 71672392 390161532 390161532 390161532 390161532 390161532 24605749 24605749 24605749 24605749 511425051 340950034 340950034 392559473 404218891 701231622 382777659 3...
result:
ok 8746 tokens
Test #58:
score: 0
Accepted
time: 322ms
memory: 272616kb
input:
30000 15 30000 12 7 10 15 5 2 11 4 7 12 2 12 6 6 1 5 11 7 1 4 14 12 15 6 1 15 7 1 4 5 9 5 11 6 4 12 1 11 14 8 8 6 15 10 11 11 11 4 4 2 11 10 3 5 10 1 1 6 5 11 11 8 12 2 5 4 7 4 2 5 3 6 5 1 13 4 2 11 10 7 3 15 6 15 13 4 10 2 11 4 4 11 12 5 4 2 9 15 4 9 12 5 9 1 10 7 15 14 14 11 14 7 10 7 7 10 10 3 3 ...
output:
422825564 173618451 369359593 320019089 822965970 520883044 806325492 369272646 490312261 276458720 297112238 902887719 359707127 648508474 460078842 111250807 233596313 332001014 694787936 388363595 505553734 125839435 353657423 74619701 520944322 978282345 871352168 159818860 620006959 333023627 5...
result:
ok 30000 tokens
Test #59:
score: 0
Accepted
time: 323ms
memory: 272724kb
input:
30000 15 30000 6 2 2 11 3 3 2 5 4 1 9 11 2 10 1 10 9 9 10 2 8 10 14 8 10 13 6 8 8 3 4 4 14 4 14 2 12 12 7 8 3 2 9 2 14 11 9 4 9 1 10 8 3 2 4 7 14 11 6 15 14 12 6 1 10 13 4 10 11 2 8 4 7 10 2 5 15 8 8 9 7 11 15 14 12 1 7 13 5 14 6 7 8 11 14 13 13 4 5 5 7 7 15 11 14 14 9 4 2 13 6 6 15 15 15 8 12 10 13...
output:
911850639 306319924 704128449 774810437 723572106 745848746 996839028 540861711 690484474 567044611 532989909 837374986 604256643 228528261 479173379 91352124 76735246 510362953 812042680 822703379 96627561 31861849 705093455 806658813 38850320 823895999 763777444 63070413 444277867 143317154 829787...
result:
ok 30000 tokens
Test #60:
score: 0
Accepted
time: 312ms
memory: 272628kb
input:
30000 15 30000 1 3 3 2 1 6 11 6 4 5 8 8 2 8 14 9 10 3 8 2 10 13 2 4 13 14 3 11 14 4 4 10 1 13 8 12 2 10 13 10 5 13 10 7 1 12 10 1 14 12 13 14 14 6 11 13 4 8 9 2 9 2 7 12 13 1 3 9 12 12 14 1 3 13 14 4 9 1 13 3 7 8 6 4 6 5 5 11 6 13 9 12 14 7 5 14 11 10 7 3 2 12 4 15 13 8 3 7 4 7 9 6 1 14 4 13 10 11 1...
output:
695654402 44021274 254792959 693770195 566765790 324209157 119611695 617317219 301196910 804178987 382874052 942441736 413566869 409687723 414634185 669694655 543808857 256146538 67809146 834834286 653593698 860384091 992193686 414986262 14111135 354882059 802547633 318815276 592492221 810356830 498...
result:
ok 30000 tokens
Test #61:
score: 0
Accepted
time: 324ms
memory: 272564kb
input:
30000 15 30000 2 7 15 12 15 10 7 15 9 12 5 15 15 6 7 5 6 13 9 7 4 2 15 6 14 3 8 3 6 12 2 6 7 1 2 15 11 13 12 14 7 13 8 1 9 14 11 5 3 8 14 3 5 3 4 12 1 12 11 3 2 3 2 10 1 13 1 7 13 15 7 3 9 10 6 5 1 2 7 11 4 15 12 4 13 14 14 7 12 5 9 3 10 13 1 10 7 6 3 1 2 7 1 1 2 9 13 15 13 13 10 13 8 6 11 5 14 11 1...
output:
144411293 269002213 124284731 376229243 210868296 130318287 767330290 100032485 686506705 436229375 366854883 535501260 655239997 723808410 311160595 716934593 813285259 608332841 336926304 673852608 7184886 267547351 300856584 656010697 867332696 84392952 552200686 624771665 570597968 841674781 309...
result:
ok 30000 tokens
Test #62:
score: 0
Accepted
time: 339ms
memory: 272892kb
input:
30000 15 30000 10 2 5 11 7 14 13 2 14 12 15 11 14 5 10 8 11 7 4 9 8 15 2 9 7 15 3 2 3 13 14 5 6 5 10 13 6 4 9 14 6 1 13 1 13 10 9 1 1 13 8 4 1 9 12 14 11 6 14 8 6 7 12 13 8 13 14 14 12 11 9 5 8 14 3 14 3 12 13 1 12 14 7 1 12 1 14 15 13 5 13 9 3 9 12 13 11 11 10 15 5 15 10 12 5 10 10 15 4 5 2 15 5 1 ...
output:
277733635 237579028 180832486 704228788 605345120 891501570 230297208 717621293 16772585 519449810 349956873 317148184 882401416 391888896 613464099 573145292 210929203 699445337 206163165 514952921 164680380 717412599 167755887 664483528 617617081 294884241 646564297 772905926 696720290 529046725 8...
result:
ok 30000 tokens
Test #63:
score: 0
Accepted
time: 324ms
memory: 272632kb
input:
30000 15 30000 4 11 7 4 4 12 11 4 12 14 14 8 14 4 14 3 8 4 3 3 12 11 5 4 13 1 6 13 15 15 14 5 12 11 1 15 11 6 10 2 2 11 10 10 7 10 11 2 11 6 4 8 9 6 7 7 15 9 13 15 15 13 14 15 13 11 5 13 1 4 12 8 1 2 2 5 13 8 15 4 3 6 9 14 13 3 12 9 15 6 2 13 9 4 8 15 10 13 7 6 3 8 6 15 9 10 11 2 11 11 14 8 10 6 13 ...
output:
176911054 192496265 229759211 677501694 730256044 125595902 97624243 125426053 505701065 670834234 143071404 67409584 197160379 754101840 532983156 190029336 183929637 157999763 684942416 752527933 77521510 677163517 293235383 635573878 970359073 379556449 258040697 352726849 992955172 92948500 2684...
result:
ok 30000 tokens
Test #64:
score: 0
Accepted
time: 330ms
memory: 272740kb
input:
30000 15 30000 9 8 10 11 12 14 8 13 4 3 8 15 12 14 1 9 11 8 7 2 5 13 10 13 12 9 9 14 14 9 15 1 9 15 4 12 5 12 12 15 12 3 10 7 10 5 3 1 9 6 10 15 9 10 3 15 1 11 1 11 8 9 3 6 4 10 10 1 3 13 6 7 11 8 8 8 9 10 2 14 13 1 8 3 4 3 8 3 1 5 6 1 8 6 12 10 12 3 1 14 2 9 3 11 15 6 8 5 6 2 14 11 9 1 8 8 3 1 2 6 ...
output:
288608384 479424503 19861618 965843147 666999743 826900204 200513189 55241793 266573584 522764094 608828540 888444240 684634228 308258526 799673534 784028889 603264038 994290278 795285562 234659887 512038296 595129357 414604643 972952179 44656275 287014373 518293475 657934701 778817341 766374702 731...
result:
ok 30000 tokens
Test #65:
score: 0
Accepted
time: 12ms
memory: 6592kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #66:
score: 0
Accepted
time: 13ms
memory: 6488kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #67:
score: 0
Accepted
time: 8ms
memory: 6672kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #68:
score: 0
Accepted
time: 2024ms
memory: 139628kb
input:
30000 15 30000 15 15 15 14 14 14 15 15 14 15 15 15 14 15 15 15 14 15 15 15 14 15 14 15 14 14 14 14 14 14 15 15 14 14 15 14 14 15 14 15 14 14 14 15 14 14 14 15 14 15 14 14 14 15 15 15 14 15 14 15 14 14 14 15 14 14 14 14 15 15 15 15 14 15 14 14 14 15 14 15 14 14 14 15 14 15 14 15 15 14 15 15 14 15 14 ...
output:
271303973 393197562 242411169 564512217 413395002 830609754 19828254 648605494 468904844 761697230 409067600 761697230 892942863 281479889 735134544 300358846 130831501 467669709 718657262 467669709 288885758 353802173 514478210 988186286 200140084 801984458 202058806 801984458 103702931 206100357 8...
result:
ok 30000 tokens
Test #69:
score: 0
Accepted
time: 2022ms
memory: 139736kb
input:
30000 15 30000 15 15 14 15 15 15 14 15 14 15 14 15 15 15 14 15 15 14 15 14 14 14 14 14 15 14 14 14 15 15 15 15 14 15 14 14 15 15 14 14 15 14 15 14 15 14 15 15 14 14 14 15 15 14 14 14 14 14 15 15 15 14 14 15 14 14 15 14 14 15 14 14 15 15 15 14 15 15 14 14 14 14 15 15 15 14 15 14 15 15 15 15 15 14 14 ...
output:
144286857 139929931 482364038 778779991 373367544 640112819 767474108 166148260 439230524 454881360 64049068 555245277 481485550 555245277 158950371 567652772 158950371 289891502 810282968 483253164 974654751 658763223 757484856 569464391 278295284 809395835 577462905 737197266 628910641 393789076 1...
result:
ok 30000 tokens
Test #70:
score: 0
Accepted
time: 1998ms
memory: 139584kb
input:
30000 15 30000 14 15 14 15 14 14 15 15 14 14 15 14 15 15 15 14 14 14 15 15 15 15 14 14 14 15 14 15 15 14 14 15 14 14 15 15 14 15 14 15 15 14 14 14 15 15 15 15 14 15 14 14 14 14 15 15 15 14 14 14 15 15 14 14 14 14 15 15 15 15 14 14 14 14 14 14 14 14 15 14 14 14 14 15 15 15 15 15 15 15 14 15 15 15 15 ...
output:
934044862 786017894 123126924 132826079 123126924 389860364 4703120 389860364 45519774 901100612 330646678 703911303 481508126 106354267 764554326 587180464 793987507 273450870 589200097 407757573 437947314 650915897 219753770 460144593 141417431 574726287 516090915 250056301 152233410 388242277 731...
result:
ok 30000 tokens
Test #71:
score: 0
Accepted
time: 200ms
memory: 139804kb
input:
30000 15 30000 15 1 15 1 1 15 15 15 15 15 1 15 15 15 1 15 15 15 1 1 15 1 1 1 1 15 1 15 15 15 1 1 1 15 15 15 15 15 15 15 1 15 1 1 15 15 1 1 1 15 1 1 1 1 15 1 1 15 1 15 15 15 1 1 1 1 15 15 15 1 1 15 15 1 15 15 15 1 15 15 15 15 15 1 1 1 15 1 1 15 15 15 15 15 15 1 1 1 1 1 1 1 1 1 1 1 15 15 15 15 15 1 15...
output:
327899433 273530187 109975393 131223449 109975393 548940291 248149541 644812394 248149541 727510056 930207310 370920892 91277683 272283673 91277683 370920892 572591615 137191735 674642351 577373145 667351777 488161966 123859088 859641967 915697269 859641967 915697269 760513994 915697269 813823203 43...
result:
ok 30000 tokens
Test #72:
score: 0
Accepted
time: 184ms
memory: 139684kb
input:
30000 15 30000 1 1 1 15 1 1 1 15 1 15 1 1 15 1 1 1 15 1 15 1 1 15 1 1 1 15 1 1 15 1 1 15 15 15 1 1 1 1 15 15 1 15 15 15 1 15 1 1 1 1 15 15 15 1 15 15 15 1 15 15 1 15 15 15 1 1 15 15 1 15 15 15 15 1 15 15 15 1 15 1 1 15 15 15 1 15 1 1 1 1 1 15 15 1 15 15 1 15 1 1 1 15 15 1 1 1 1 15 15 1 1 15 1 15 1 1...
output:
957107477 381191213 134732105 24492869 367393035 24492869 692199425 589689690 692199425 816738972 145619034 687023420 322907770 403792323 67418727 366686312 585320063 793846121 212653884 195075201 212653884 842925198 664945734 989986833 874381553 967413046 113235969 319501450 583156039 441860480 103...
result:
ok 30000 tokens
Test #73:
score: 0
Accepted
time: 183ms
memory: 139636kb
input:
30000 15 30000 1 15 1 1 1 1 1 15 1 1 15 15 15 15 1 1 15 1 1 1 15 15 15 15 1 15 15 15 1 1 15 15 15 1 1 15 1 15 1 15 15 1 15 15 15 15 1 1 1 15 15 15 1 1 15 15 1 1 15 1 15 1 1 15 1 1 15 1 1 15 1 1 15 1 15 1 15 15 1 15 15 1 15 15 1 15 15 1 15 1 1 1 15 15 15 15 15 1 15 15 15 15 15 1 15 1 15 1 1 15 1 15 1...
output:
885998411 312799576 689490755 378714168 624194223 378714168 885998411 591463549 378906488 855869619 859112049 624700039 957051983 380358803 906974272 127014575 485392124 165458722 485392124 293171389 195129029 930446729 195129029 930446729 979524346 930446729 445450889 12516368 241242971 12516368 44...
result:
ok 30000 tokens
Test #74:
score: 0
Accepted
time: 309ms
memory: 139684kb
input:
30000 15 30000 14 14 15 14 14 14 14 14 14 15 15 14 14 14 15 14 14 14 15 14 15 15 14 14 15 15 15 15 15 15 15 14 15 15 14 14 14 14 14 14 15 14 15 15 15 14 14 14 14 14 14 15 14 14 14 15 14 14 14 15 15 15 14 14 15 14 15 14 14 14 15 14 14 14 14 15 14 14 14 15 14 15 15 15 15 14 14 14 14 14 15 15 15 15 14 ...
output:
559144059 176936220 761538112 813251100 876179632 226602662 10077336 37101663 764478744 764478744 808524556 17222647 433042077 433042077 154037043 154037043 958908974 958908974 550285500 582629587 783558978 348842093 444809574 879511458 347755031 347755031 938745588 938745588 636055074 636055074 974...
result:
ok 30000 tokens
Test #75:
score: 0
Accepted
time: 299ms
memory: 139640kb
input:
30000 15 30000 14 15 15 14 14 15 14 15 14 14 14 14 14 15 14 15 15 14 14 14 15 15 15 15 15 14 14 14 15 14 15 14 15 14 15 14 15 15 14 14 14 15 15 15 14 14 14 15 15 15 15 14 14 15 15 15 14 15 14 15 15 14 14 14 15 14 15 15 14 15 14 15 15 15 14 14 14 15 15 14 14 14 14 15 14 15 14 14 15 14 15 15 14 14 15 ...
output:
891448418 866843958 176519646 176519646 116756294 116756294 594445301 361980982 540094246 540094246 125976558 162978189 395234138 395234138 734739729 734739729 12865452 12865452 689667580 689667580 180876541 784234043 300268952 810166468 993459747 993459747 970699461 762374651 849852584 849852584 18...
result:
ok 30000 tokens
Test #76:
score: 0
Accepted
time: 292ms
memory: 139808kb
input:
30000 15 30000 14 14 14 14 14 15 14 14 15 15 15 14 14 14 14 15 14 14 15 15 15 15 15 15 15 15 14 14 14 14 15 14 14 15 14 14 15 15 14 15 15 14 15 14 14 14 15 14 15 14 14 14 15 15 14 15 15 15 14 14 14 14 14 14 14 15 14 15 14 14 14 14 14 14 14 15 14 14 15 14 15 15 14 14 14 14 15 15 15 15 15 15 15 14 15 ...
output:
692028145 692028145 62484031 62484031 867622764 867622764 724766884 724766884 88791421 88791421 573896963 146947883 60463571 193535368 537511842 394110625 715438485 895531038 125966928 298144165 427567018 812712667 434027841 434027841 875969697 875969697 262350710 262350710 542268879 542268879 78945...
result:
ok 30000 tokens
Test #77:
score: 0
Accepted
time: 10ms
memory: 6684kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 ...
result:
ok 30000 tokens
Test #78:
score: 0
Accepted
time: 7ms
memory: 6692kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022...
result:
ok 30000 tokens
Test #79:
score: 0
Accepted
time: 3ms
memory: 6668kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 ...
result:
ok 30000 tokens
Test #80:
score: 0
Accepted
time: 10ms
memory: 6488kb
input:
30000 1 30000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
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 30000 tokens
Extra Test:
score: 0
Extra Test Passed