QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#494312 | #9141. Array Spread | ucup-team987# | TL | 2573ms | 4316kb | C++20 | 19.5kb | 2024-07-27 15:10:55 | 2024-07-27 15:10:56 |
Judging History
你现在查看的是最新测评结果
- [2024-09-18 18:58:44]
- hack成功,自动添加数据
- (/hack/840)
- [2024-09-18 18:53:02]
- hack成功,自动添加数据
- (/hack/839)
- [2024-07-29 03:53:23]
- hack成功,自动添加数据
- (/hack/753)
- [2024-07-29 03:51:16]
- hack成功,自动添加数据
- (/hack/752)
- [2024-07-29 03:50:24]
- hack成功,自动添加数据
- (/hack/751)
- [2024-07-29 03:48:52]
- hack成功,自动添加数据
- (/hack/750)
- [2024-07-27 15:10:55]
- 提交
answer
/**
* date : 2024-07-27 16:10:44
* author : Nyaan
*/
#define NDEBUG
using namespace std;
// intrinstic
#include <immintrin.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <cfloat>
#include <chrono>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <streambuf>
#include <string>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
// utility
namespace Nyaan {
using ll = long long;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = vector<vector<T>>;
using vi = vector<int>;
using vl = vector<long long>;
using vd = V<double>;
using vs = V<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
template <typename T>
using minpq = priority_queue<T, vector<T>, greater<T>>;
template <typename T, typename U>
struct P : pair<T, U> {
template <typename... Args>
P(Args... args) : pair<T, U>(args...) {}
using pair<T, U>::first;
using pair<T, U>::second;
P &operator+=(const P &r) {
first += r.first;
second += r.second;
return *this;
}
P &operator-=(const P &r) {
first -= r.first;
second -= r.second;
return *this;
}
P &operator*=(const P &r) {
first *= r.first;
second *= r.second;
return *this;
}
template <typename S>
P &operator*=(const S &r) {
first *= r, second *= r;
return *this;
}
P operator+(const P &r) const { return P(*this) += r; }
P operator-(const P &r) const { return P(*this) -= r; }
P operator*(const P &r) const { return P(*this) *= r; }
template <typename S>
P operator*(const S &r) const {
return P(*this) *= r;
}
P operator-() const { return P{-first, -second}; }
};
using pl = P<ll, ll>;
using pi = P<int, int>;
using vp = V<pl>;
constexpr int inf = 1001001001;
constexpr long long infLL = 4004004004004004004LL;
template <typename T>
int sz(const T &t) {
return t.size();
}
template <typename T, typename U>
inline bool amin(T &x, U y) {
return (y < x) ? (x = y, true) : false;
}
template <typename T, typename U>
inline bool amax(T &x, U y) {
return (x < y) ? (x = y, true) : false;
}
template <typename T>
inline T Max(const vector<T> &v) {
return *max_element(begin(v), end(v));
}
template <typename T>
inline T Min(const vector<T> &v) {
return *min_element(begin(v), end(v));
}
template <typename T>
inline long long Sum(const vector<T> &v) {
return accumulate(begin(v), end(v), 0LL);
}
template <typename T>
int lb(const vector<T> &v, const T &a) {
return lower_bound(begin(v), end(v), a) - begin(v);
}
template <typename T>
int ub(const vector<T> &v, const T &a) {
return upper_bound(begin(v), end(v), a) - begin(v);
}
constexpr long long TEN(int n) {
long long ret = 1, x = 10;
for (; n; x *= x, n >>= 1) ret *= (n & 1 ? x : 1);
return ret;
}
template <typename T, typename U>
pair<T, U> mkp(const T &t, const U &u) {
return make_pair(t, u);
}
template <typename T>
vector<T> mkrui(const vector<T> &v, bool rev = false) {
vector<T> ret(v.size() + 1);
if (rev) {
for (int i = int(v.size()) - 1; i >= 0; i--) ret[i] = v[i] + ret[i + 1];
} else {
for (int i = 0; i < int(v.size()); i++) ret[i + 1] = ret[i] + v[i];
}
return ret;
};
template <typename T>
vector<T> mkuni(const vector<T> &v) {
vector<T> ret(v);
sort(ret.begin(), ret.end());
ret.erase(unique(ret.begin(), ret.end()), ret.end());
return ret;
}
template <typename F>
vector<int> mkord(int N, F f) {
vector<int> ord(N);
iota(begin(ord), end(ord), 0);
sort(begin(ord), end(ord), f);
return ord;
}
template <typename T>
vector<int> mkinv(vector<T> &v) {
int max_val = *max_element(begin(v), end(v));
vector<int> inv(max_val + 1, -1);
for (int i = 0; i < (int)v.size(); i++) inv[v[i]] = i;
return inv;
}
vector<int> mkiota(int n) {
vector<int> ret(n);
iota(begin(ret), end(ret), 0);
return ret;
}
template <typename T>
T mkrev(const T &v) {
T w{v};
reverse(begin(w), end(w));
return w;
}
template <typename T>
bool nxp(T &v) {
return next_permutation(begin(v), end(v));
}
// 返り値の型は入力の T に依存
// i 要素目 : [0, a[i])
template <typename T>
vector<vector<T>> product(const vector<T> &a) {
vector<vector<T>> ret;
vector<T> v;
auto dfs = [&](auto rc, int i) -> void {
if (i == (int)a.size()) {
ret.push_back(v);
return;
}
for (int j = 0; j < a[i]; j++) v.push_back(j), rc(rc, i + 1), v.pop_back();
};
dfs(dfs, 0);
return ret;
}
// F : function(void(T&)), mod を取る操作
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I, const function<void(T &)> &f) {
T res = I;
for (; n; f(a = a * a), n >>= 1) {
if (n & 1) f(res = res * a);
}
return res;
}
// T : 整数型のときはオーバーフローに注意する
template <typename T>
T Power(T a, long long n, const T &I = T{1}) {
return Power(a, n, I, function<void(T &)>{[](T &) -> void {}});
}
template <typename T>
T Rev(const T &v) {
T res = v;
reverse(begin(res), end(res));
return res;
}
template <typename T>
vector<T> Transpose(const vector<T> &v) {
using U = typename T::value_type;
if(v.empty()) return {};
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
res[j][i] = v[i][j];
}
}
return res;
}
template <typename T>
vector<T> Rotate(const vector<T> &v, int clockwise = true) {
using U = typename T::value_type;
int H = v.size(), W = v[0].size();
vector res(W, T(H, U{}));
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
if (clockwise) {
res[W - 1 - j][i] = v[i][j];
} else {
res[j][H - 1 - i] = v[i][j];
}
}
}
return res;
}
} // namespace Nyaan
// bit operation
namespace Nyaan {
__attribute__((target("popcnt"))) inline int popcnt(const u64 &a) {
return __builtin_popcountll(a);
}
inline int lsb(const u64 &a) { return a ? __builtin_ctzll(a) : 64; }
inline int ctz(const u64 &a) { return a ? __builtin_ctzll(a) : 64; }
inline int msb(const u64 &a) { return a ? 63 - __builtin_clzll(a) : -1; }
template <typename T>
inline int gbit(const T &a, int i) {
return (a >> i) & 1;
}
template <typename T>
inline void sbit(T &a, int i, bool b) {
if (gbit(a, i) != b) a ^= T(1) << i;
}
constexpr long long PW(int n) { return 1LL << n; }
constexpr long long MSK(int n) { return (1LL << n) - 1; }
} // namespace Nyaan
// inout
namespace Nyaan {
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
os << p.first << " " << p.second;
return os;
}
template <typename T, typename U>
istream &operator>>(istream &is, pair<T, U> &p) {
is >> p.first >> p.second;
return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
int s = (int)v.size();
for (int i = 0; i < s; i++) os << (i ? " " : "") << v[i];
return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
for (auto &x : v) is >> x;
return is;
}
istream &operator>>(istream &is, __int128_t &x) {
string S;
is >> S;
x = 0;
int flag = 0;
for (auto &c : S) {
if (c == '-') {
flag = true;
continue;
}
x *= 10;
x += c - '0';
}
if (flag) x = -x;
return is;
}
istream &operator>>(istream &is, __uint128_t &x) {
string S;
is >> S;
x = 0;
for (auto &c : S) {
x *= 10;
x += c - '0';
}
return is;
}
ostream &operator<<(ostream &os, __int128_t x) {
if (x == 0) return os << 0;
if (x < 0) os << '-', x = -x;
string S;
while (x) S.push_back('0' + x % 10), x /= 10;
reverse(begin(S), end(S));
return os << S;
}
ostream &operator<<(ostream &os, __uint128_t x) {
if (x == 0) return os << 0;
string S;
while (x) S.push_back('0' + x % 10), x /= 10;
reverse(begin(S), end(S));
return os << S;
}
void in() {}
template <typename T, class... U>
void in(T &t, U &...u) {
cin >> t;
in(u...);
}
void out() { cout << "\n"; }
template <typename T, class... U, char sep = ' '>
void out(const T &t, const U &...u) {
cout << t;
if (sizeof...(u)) cout << sep;
out(u...);
}
struct IoSetupNya {
IoSetupNya() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(15);
cerr << fixed << setprecision(7);
}
} iosetupnya;
} // namespace Nyaan
// debug
#ifdef NyaanDebug
#define trc(...) (void(0))
#else
#define trc(...) (void(0))
#endif
#ifdef NyaanLocal
#define trc2(...) (void(0))
#else
#define trc2(...) (void(0))
#endif
// macro
#define each(x, v) for (auto&& x : v)
#define each2(x, y, v) for (auto&& [x, y] : v)
#define all(v) (v).begin(), (v).end()
#define rep(i, N) for (long long i = 0; i < (long long)(N); i++)
#define repr(i, N) for (long long i = (long long)(N)-1; i >= 0; i--)
#define rep1(i, N) for (long long i = 1; i <= (long long)(N); i++)
#define repr1(i, N) for (long long i = (N); (long long)(i) > 0; i--)
#define reg(i, a, b) for (long long i = (a); i < (b); i++)
#define regr(i, a, b) for (long long i = (b)-1; i >= (a); i--)
#define fi first
#define se second
#define ini(...) \
int __VA_ARGS__; \
in(__VA_ARGS__)
#define inl(...) \
long long __VA_ARGS__; \
in(__VA_ARGS__)
#define ins(...) \
string __VA_ARGS__; \
in(__VA_ARGS__)
#define in2(s, t) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i]); \
}
#define in3(s, t, u) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i], u[i]); \
}
#define in4(s, t, u, v) \
for (int i = 0; i < (int)s.size(); i++) { \
in(s[i], t[i], u[i], v[i]); \
}
#define die(...) \
do { \
Nyaan::out(__VA_ARGS__); \
return; \
} while (0)
namespace Nyaan {
void solve();
}
int main() { Nyaan::solve(); }
//
template <typename T>
struct edge {
int src, to;
T cost;
edge(int _to, T _cost) : src(-1), to(_to), cost(_cost) {}
edge(int _src, int _to, T _cost) : src(_src), to(_to), cost(_cost) {}
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() const { return to; }
};
template <typename T>
using Edges = vector<edge<T>>;
template <typename T>
using WeightedGraph = vector<Edges<T>>;
using UnweightedGraph = vector<vector<int>>;
// Input of (Unweighted) Graph
UnweightedGraph graph(int N, int M = -1, bool is_directed = false,
bool is_1origin = true) {
UnweightedGraph g(N);
if (M == -1) M = N - 1;
for (int _ = 0; _ < M; _++) {
int x, y;
cin >> x >> y;
if (is_1origin) x--, y--;
g[x].push_back(y);
if (!is_directed) g[y].push_back(x);
}
return g;
}
// Input of Weighted Graph
template <typename T>
WeightedGraph<T> wgraph(int N, int M = -1, bool is_directed = false,
bool is_1origin = true) {
WeightedGraph<T> g(N);
if (M == -1) M = N - 1;
for (int _ = 0; _ < M; _++) {
int x, y;
cin >> x >> y;
T c;
cin >> c;
if (is_1origin) x--, y--;
g[x].emplace_back(x, y, c);
if (!is_directed) g[y].emplace_back(y, x, c);
}
return g;
}
// Input of Edges
template <typename T>
Edges<T> esgraph([[maybe_unused]] int N, int M, int is_weighted = true,
bool is_1origin = true) {
Edges<T> es;
for (int _ = 0; _ < M; _++) {
int x, y;
cin >> x >> y;
T c;
if (is_weighted)
cin >> c;
else
c = 1;
if (is_1origin) x--, y--;
es.emplace_back(x, y, c);
}
return es;
}
// Input of Adjacency Matrix
template <typename T>
vector<vector<T>> adjgraph(int N, int M, T INF, int is_weighted = true,
bool is_directed = false, bool is_1origin = true) {
vector<vector<T>> d(N, vector<T>(N, INF));
for (int _ = 0; _ < M; _++) {
int x, y;
cin >> x >> y;
T c;
if (is_weighted)
cin >> c;
else
c = 1;
if (is_1origin) x--, y--;
d[x][y] = c;
if (!is_directed) d[y][x] = c;
}
return d;
}
/**
* @brief グラフテンプレート
* @docs docs/graph/graph-template.md
*/
template <typename T>
struct Dual_of_Shortest_Path {
int N;
vector<vector<edge<T>>> g;
T INF;
vector<T> d;
Dual_of_Shortest_Path(int _n)
: N(_n), g(N), INF(numeric_limits<T>::max() / 2.1), d(N, INF) {}
// add constraint f(j) <= f(i) + w
void add_edge(int i, int j, T c) { g[i].emplace_back(i, j, c); }
// solve max{f(t) - f(s)} for each t
// if unsatisfiable, return empty vector
vector<T> solve(int start = 0) {
d[start] = 0;
for (int loop = 0; loop < N; ++loop) {
int upd = 0;
for (int i = 0; i < N; ++i) {
for (auto& e : g[i]) {
if (d[i] + e.cost < d[e.to]) {
d[e.to] = d[i] + e.cost;
upd = 1;
}
}
}
if (!upd) break;
if (loop == N - 1) return {};
}
return d;
}
};
/**
* @brief 牛ゲー(最短路問題の双対)
*/
using namespace Nyaan;
template <uint32_t mod>
struct LazyMontgomeryModInt {
using mint = LazyMontgomeryModInt;
using i32 = int32_t;
using u32 = uint32_t;
using u64 = uint64_t;
static constexpr u32 get_r() {
u32 ret = mod;
for (i32 i = 0; i < 4; ++i) ret *= 2 - mod * ret;
return ret;
}
static constexpr u32 r = get_r();
static constexpr u32 n2 = -u64(mod) % mod;
static_assert(mod < (1 << 30), "invalid, mod >= 2 ^ 30");
static_assert((mod & 1) == 1, "invalid, mod % 2 == 0");
static_assert(r * mod == 1, "this code has bugs.");
u32 a;
constexpr LazyMontgomeryModInt() : a(0) {}
constexpr LazyMontgomeryModInt(const int64_t &b)
: a(reduce(u64(b % mod + mod) * n2)){};
static constexpr u32 reduce(const u64 &b) {
return (b + u64(u32(b) * u32(-r)) * mod) >> 32;
}
constexpr mint &operator+=(const mint &b) {
if (i32(a += b.a - 2 * mod) < 0) a += 2 * mod;
return *this;
}
constexpr mint &operator-=(const mint &b) {
if (i32(a -= b.a) < 0) a += 2 * mod;
return *this;
}
constexpr mint &operator*=(const mint &b) {
a = reduce(u64(a) * b.a);
return *this;
}
constexpr mint &operator/=(const mint &b) {
*this *= b.inverse();
return *this;
}
constexpr mint operator+(const mint &b) const { return mint(*this) += b; }
constexpr mint operator-(const mint &b) const { return mint(*this) -= b; }
constexpr mint operator*(const mint &b) const { return mint(*this) *= b; }
constexpr mint operator/(const mint &b) const { return mint(*this) /= b; }
constexpr bool operator==(const mint &b) const {
return (a >= mod ? a - mod : a) == (b.a >= mod ? b.a - mod : b.a);
}
constexpr bool operator!=(const mint &b) const {
return (a >= mod ? a - mod : a) != (b.a >= mod ? b.a - mod : b.a);
}
constexpr mint operator-() const { return mint() - mint(*this); }
constexpr mint operator+() const { return mint(*this); }
constexpr mint pow(u64 n) const {
mint ret(1), mul(*this);
while (n > 0) {
if (n & 1) ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
constexpr mint inverse() const {
int x = get(), y = mod, u = 1, v = 0, t = 0, tmp = 0;
while (y > 0) {
t = x / y;
x -= t * y, u -= t * v;
tmp = x, x = y, y = tmp;
tmp = u, u = v, v = tmp;
}
return mint{u};
}
friend ostream &operator<<(ostream &os, const mint &b) {
return os << b.get();
}
friend istream &operator>>(istream &is, mint &b) {
int64_t t;
is >> t;
b = LazyMontgomeryModInt<mod>(t);
return (is);
}
constexpr u32 get() const {
u32 ret = reduce(a);
return ret >= mod ? ret - mod : ret;
}
static constexpr u32 get_mod() { return mod; }
};
using namespace std;
// コンストラクタの MAX に 「C(n, r) や fac(n) でクエリを投げる最大の n 」
// を入れると倍速くらいになる
// mod を超えて前計算して 0 割りを踏むバグは対策済み
template <typename T>
struct Binomial {
vector<T> f, g, h;
Binomial(int MAX = 0) {
assert(T::get_mod() != 0 && "Binomial<mint>()");
f.resize(1, T{1});
g.resize(1, T{1});
h.resize(1, T{1});
if (MAX > 0) extend(MAX + 1);
}
void extend(int m = -1) {
int n = f.size();
if (m == -1) m = n * 2;
m = min<int>(m, T::get_mod());
if (n >= m) return;
f.resize(m);
g.resize(m);
h.resize(m);
for (int i = n; i < m; i++) f[i] = f[i - 1] * T(i);
g[m - 1] = f[m - 1].inverse();
h[m - 1] = g[m - 1] * f[m - 2];
for (int i = m - 2; i >= n; i--) {
g[i] = g[i + 1] * T(i + 1);
h[i] = g[i] * f[i - 1];
}
}
T fac(int i) {
if (i < 0) return T(0);
while (i >= (int)f.size()) extend();
return f[i];
}
T finv(int i) {
if (i < 0) return T(0);
while (i >= (int)g.size()) extend();
return g[i];
}
T inv(int i) {
if (i < 0) return -inv(-i);
while (i >= (int)h.size()) extend();
return h[i];
}
T C(int n, int r) {
if (n < 0 || n < r || r < 0) return T(0);
return fac(n) * finv(n - r) * finv(r);
}
inline T operator()(int n, int r) { return C(n, r); }
template <typename I>
T multinomial(const vector<I>& r) {
static_assert(is_integral<I>::value == true);
int n = 0;
for (auto& x : r) {
if (x < 0) return T(0);
n += x;
}
T res = fac(n);
for (auto& x : r) res *= finv(x);
return res;
}
template <typename I>
T operator()(const vector<I>& r) {
return multinomial(r);
}
T C_naive(int n, int r) {
if (n < 0 || n < r || r < 0) return T(0);
T ret = T(1);
r = min(r, n - r);
for (int i = 1; i <= r; ++i) ret *= inv(i) * (n--);
return ret;
}
T P(int n, int r) {
if (n < 0 || n < r || r < 0) return T(0);
return fac(n) * finv(n - r);
}
// [x^r] 1 / (1-x)^n
T H(int n, int r) {
if (n < 0 || r < 0) return T(0);
return r == 0 ? 1 : C(n + r - 1, r);
}
};
//
using namespace Nyaan;
using mint = LazyMontgomeryModInt<998244353>;
// using mint = LazyMontgomeryModInt<1000000007>;
using vm = vector<mint>;
using vvm = vector<vm>;
Binomial<mint> C;
void q() {
inl(N, M);
vi L(M), R(M);
in2(L, R);
each(x, L) x--;
vi xs = L;
each(x, R) xs.push_back(x);
xs = mkuni(xs);
N = sz(xs);
each(x, L) x = lb(xs, x);
each(x, R) x = lb(xs, x);
double ng = 0.0, ok = 5000.0;
rep(t, 60) {
double m = (ng + ok) / 2;
Dual_of_Shortest_Path<double> ds(N);
rep(i, N - 1) ds.add_edge(i + 1, i, 0);
rep(i, M) {
ds.add_edge(R[i], L[i], -1);
ds.add_edge(L[i], R[i], m);
}
auto ans = ds.solve(N - 1);
// trc(m, ans);
(sz(ans) ? ok : ng) = m;
}
double ans = (ok + ng) / 2;
trc(ans);
rep1(denom, 20000) {
ll numer = llround(ans * denom);
double bns = 1.0 * numer / denom;
double gosa = abs(ans - bns) / max(ans, bns);
if (gosa < 1e-10) {
cout << mint(numer) / denom << "\n";
return;
}
}
exit(1);
}
void Nyaan::solve() {
int t = 1;
in(t);
while (t--) q();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
3 3 3 1 3 2 3 1 2 12 6 2 3 5 7 1 9 4 8 1 2 7 11 4 5 3 4 2 3 1 2 4 4 1 1
output:
1 2 499122178
result:
ok 3 number(s): "1 2 499122178"
Test #2:
score: 0
Accepted
time: 13ms
memory: 3552kb
input:
2000 1000000000 1 259923446 367011266 1000000000 1 882434225 971573327 1000000000 1 41585677 470369580 1000000000 1 371902212 947250194 1000000000 1 787209148 924205796 1000000000 1 259074809 960876164 1000000000 1 148079314 188254573 1000000000 1 940091047 948318624 1000000000 1 40636497 743979446 ...
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 2000 numbers
Test #3:
score: 0
Accepted
time: 13ms
memory: 3756kb
input:
1000 1000000000 5 575330909 661595447 708422488 913945134 658050911 930246647 786571892 904549453 851755566 969150871 1000000000 2 198072104 844159589 8876188 644559580 1000000000 2 740802634 976972118 783909534 898449184 1000000000 2 871819537 941611957 465883854 640988372 1000000000 1 99458969 462...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 ...
result:
ok 1000 numbers
Test #4:
score: 0
Accepted
time: 16ms
memory: 3764kb
input:
500 1000000000 13 964546318 987364574 367845944 907446075 259314137 890312338 458318546 959971971 353677471 522446336 782931403 845199078 514387878 786979588 532634932 793056892 905393511 960628299 747423889 986373313 796099347 833069525 906969434 971335651 574582540 647534593 1000000000 6 987712893...
output:
3 1 3 1 1 1 1 1 1 3 2 1 1 1 3 1 2 1 1 2 1 3 1 1 1 2 1 2 2 1 1 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 2 2 1 1 3 1 2 1 1 1 1 2 3 1 1 1 1 1 1 1 3 2 1 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 3 1 1 1 1 1 1 1 2 1 1 2 1 1 1 2 1 4 1 2 1 4 1 3 1 1 1 1 1 2 1 1 4 1 ...
result:
ok 500 numbers
Test #5:
score: 0
Accepted
time: 26ms
memory: 3632kb
input:
250 1000000000 10 844342043 888135880 127033337 726074967 581308029 893912240 414276384 752837267 565680461 863374082 230362895 477723054 210479116 423381051 325072305 427826920 178306222 756423471 376470949 993759748 1000000000 2 468173597 607783582 266359996 863641680 1000000000 7 206599093 941381...
output:
2 1 2 1 3 3 1 1 1 2 1 2 2 1 3 5 2 1 1 1 2 1 2 1 3 1 2 1 3 499122178 1 1 1 1 3 1 1 1 3 3 3 1 4 1 1 1 1 1 1 1 1 5 1 4 2 1 3 1 1 1 2 5 2 1 2 6 2 2 1 2 1 1 1 5 8 2 1 2 1 1 2 2 2 1 1 5 8 3 1 1 1 8 2 6 1 1 4 2 1 1 1 1 2 2 1 2 1 1 1 1 1 1 2 1 2 1 1 4 1 1 3 1 2 3 3 2 5 1 1 1 3 2 1 1 1 3 1 1 2 1 1 1 1 3 1 1 ...
result:
ok 250 numbers
Test #6:
score: 0
Accepted
time: 25ms
memory: 3656kb
input:
250 1000000000 4 10495745 465086423 465086424 609997778 396956207 663037010 253873206 396956206 1000000000 33 596279983 655818820 226461062 338625457 407323582 423049163 711408063 778512581 220274357 226461061 702491412 711408062 686978949 688730316 369564474 434159428 778512582 787885602 675683057 ...
output:
1 2 748683266 5 6 453747435 1 10 6 1 499122183 1 4 3 1 3 1 748683266 2 499122179 10 499122178 1 499122179 4 1 7 1 665496238 2 2 2 332748119 249561090 816745381 499122178 2 499122179 5 3 4 17 1 2 2 3 249561092 1 3 924300328 499122179 2 3 332748120 2 7 3 499122187 6 374341634 1 2 332748120 2 2 2 49912...
result:
ok 250 numbers
Test #7:
score: 0
Accepted
time: 48ms
memory: 3752kb
input:
100 1000000000 17 272213590 960979163 970159974 987653658 201788340 556786243 46564706 948945765 786605927 819103747 510930374 747773556 729597186 850647589 412727504 443334406 685627406 773178988 793614323 909668193 830162056 837607472 416766039 753918198 237455713 993045890 848459092 851118478 463...
output:
8 1 1 2 3 3 1 5 1 2 8 2 1 1 3 1 3 6 3 3 2 3 7 2 1 1 3 1 2 1 5 5 2 2 4 2 7 2 1 6 1 2 5 4 5 4 1 1 1 8 6 1 4 4 5 13 1 4 9 4 8 3 8 5 4 7 1 8 1 1 1 9 2 1 6 4 4 3 1 1 1 10 4 6 11 6 6 1 1 4 1 4 2 2 13 5 1 1 5 8
result:
ok 100 numbers
Test #8:
score: 0
Accepted
time: 55ms
memory: 3828kb
input:
100 1000000000 49 187775019 193881727 145323628 162242601 964365230 971504847 226437670 229819402 46971378 49331905 871327590 883354570 310535966 323031740 904117712 916571909 458902934 484636144 13320536 14923771 571938132 574937141 89751784 102733764 412667720 421251698 908036941 932886651 2663244...
output:
2 1 1 1 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 2 3 1 1 1 1 1 1 3 1 3 1 1 1 1 1 1 1 1 2 1 1 1 2 1 1 3 1 1 1 1 3 1 1 1 1 1 2 1 1 1 1 1 2 1 2 2 1 1 1
result:
ok 100 numbers
Test #9:
score: 0
Accepted
time: 51ms
memory: 3632kb
input:
100 1000000000 33 607773622 612059886 773446566 927093401 216659567 357373353 949986996 960422356 67865304 185683459 748675762 867719748 419805439 434936264 83601801 106508219 584299087 639485780 487166380 588591547 670602250 789210083 877816826 902687951 800334389 834278741 90815648 214176329 53952...
output:
4 1 4 6 3 1 1 7 1 1 3 3 1 4 4 1 2 4 1 5 1 2 2 1 2 9 2 1 2 2 1 2 1 2 4 2 2 1 1 3 2 2 2 1 1 1 1 4 1 1 2 1 1 1 2 1 7 1 1 1 6 2 1 3 6 4 10 1 1 3 5 1 1 10 8 1 3 1 1 2 3 1 1 6 1 2 1 2 3 3 2 4 1 3 2 7 1 1 1 1
result:
ok 100 numbers
Test #10:
score: 0
Accepted
time: 55ms
memory: 3820kb
input:
100 1000000000 27 423127198 447304856 209683651 219301129 831320345 879604518 631502329 814498734 130918283 202258454 434769186 463838309 448295746 500976275 778017547 864887407 60178254 66348236 615735891 725460273 78684718 129678593 219427409 221445385 242513397 378886240 549135209 710348598 24951...
output:
748683266 2 332748119 2 855638018 2 2 2 1 1 499122179 1 630470119 1 873463814 10 3 598946613 499122178 499122179 720954257 24956110 686292996 499122178 6 2 499122180 332748122 665496237 27 17 1 15 5 199648872 6 4 3 1 285212675 2 1 4 2 499122186 698771050 844668300 887328319 332748120 1 2 499122179 4...
result:
ok 100 numbers
Test #11:
score: 0
Accepted
time: 72ms
memory: 3828kb
input:
50 1000000000 54 393385964 584227315 530511168 878333402 240442438 693353417 66549203 383382851 432995043 781030135 902504635 941834946 40257869 409360381 186795487 285734229 500620269 578283640 769614926 881642580 651338390 854914246 220143804 506609845 486528251 695975933 659594236 951619961 26914...
output:
6 3 9 1 5 1 5 7 4 9 11 7 4 10 1 1 3 1 1 7 11 12 7 6 6 7 1 14 9 5 3 11 7 5 10 1 1 14 2 8 16 4 4 2 2 6 4 1 1 9
result:
ok 50 numbers
Test #12:
score: 0
Accepted
time: 6ms
memory: 3860kb
input:
50 10 65 7 10 3 6 5 7 7 7 3 9 2 2 3 10 10 10 7 7 2 3 5 6 7 10 3 9 2 8 2 8 8 8 4 8 9 9 9 9 7 9 1 1 3 6 9 10 9 10 2 3 7 8 9 10 2 9 9 10 10 10 5 7 6 10 6 8 4 5 10 10 5 5 5 10 8 8 1 9 6 7 3 6 1 9 2 5 1 10 2 9 8 9 8 8 1 1 2 9 4 9 10 10 7 10 2 3 8 9 10 10 2 4 2 9 4 7 1 3 1 9 10 10 1 4 8 9 7 8 7 8 10 88 6 ...
output:
7 8 7 6 4 4 6 4 6 8 7 6 6 3 499122178 3 3 7 10 4 2 3 5 2 8 2 8 1 4 7 4 4 7 6 1 4 2 5 3 6 4 2 1 6 1 6 3 9 6 4
result:
ok 50 numbers
Test #13:
score: 0
Accepted
time: 117ms
memory: 3636kb
input:
25 1000000000 126 107069149 368376053 479032115 765537110 991540256 997326292 403046092 722244014 490526523 516722534 274125538 310843747 777271932 894507975 30859549 117930127 295842439 932626190 696990395 727705976 919364307 981912430 452436750 754049053 436429356 707440965 255169020 717543449 875...
output:
13 12 14 15 3 8 13 499122178 9 17 3 3 5 6 6 22 3 3 16 6 17 5 6 9 19
result:
ok 25 numbers
Test #14:
score: 0
Accepted
time: 233ms
memory: 3740kb
input:
10 1000000000 69 870434015 950861762 463726401 635711398 333118041 890448132 290535922 477961269 413309490 468893401 200588542 259174530 820993949 902249431 919016091 952057155 32176623 226256591 307850591 328322116 544612131 956816575 794988232 980183910 896176727 934471390 445409718 674881616 3109...
output:
7 21 17 13 6 11 30 26 17 14
result:
ok 10 numbers
Test #15:
score: 0
Accepted
time: 371ms
memory: 3820kb
input:
10 1000000000 226 722573032 815472621 582575925 607010515 411370955 463267466 92061989 217643130 187859011 258319855 811376535 844552673 426496326 431292091 785538560 983675713 328209738 364768843 338697990 509158393 502285144 536085577 202590577 293138489 873383022 956559039 765186726 836986281 219...
output:
15 5 5 12 18 2 13 12 35 8
result:
ok 10 numbers
Test #16:
score: 0
Accepted
time: 4ms
memory: 3808kb
input:
10 10 31 7 8 5 9 2 4 6 10 10 10 4 5 3 6 8 8 4 10 7 8 2 8 2 7 3 4 9 9 4 7 1 8 1 10 3 9 2 5 5 8 5 8 5 8 6 6 2 10 3 7 9 10 9 10 7 7 6 6 9 10 6 7 10 165 10 10 9 9 4 9 9 9 1 1 6 8 2 9 4 6 10 10 8 9 5 9 8 8 6 10 6 6 4 6 1 6 3 7 5 9 2 8 5 6 3 5 6 9 6 8 4 7 5 8 9 9 5 7 10 10 5 8 9 10 5 5 3 8 7 10 1 1 7 8 6 ...
output:
6 9 10 10 10 7 9 9 8 9
result:
ok 10 numbers
Test #17:
score: 0
Accepted
time: 665ms
memory: 3880kb
input:
5 1000000000 63 619459262 977043459 300995683 982228427 410548612 621234006 122929033 763884440 421486730 819706101 340188689 623537684 507398179 844353491 337184385 791508531 349294635 959826734 98096933 650360479 385580668 846357810 364950155 640902318 640098682 994083922 770432519 820631492 66011...
output:
8 17 6 40 44
result:
ok 5 number(s): "8 17 6 40 44"
Test #18:
score: 0
Accepted
time: 1489ms
memory: 4048kb
input:
2 1000000000 1954 214176902 795098577 427614652 861416360 690405909 903037538 224031724 678866146 103017905 175158461 481177251 880591454 774838238 795104831 887429528 996876768 889351335 987035745 391908934 489988622 83670551 709453888 679022699 842242196 78153409 642923089 232797325 414737043 6804...
output:
66 8
result:
ok 2 number(s): "66 8"
Test #19:
score: 0
Accepted
time: 1707ms
memory: 4316kb
input:
1 1000000000 2000 804998774 935072473 539475366 898950940 227523606 852755701 309719052 650340983 356982928 655220770 783115802 937764030 570168460 665560212 583166562 906377079 947557671 947616592 774446890 997986030 113320562 897048797 39935214 749273732 63763440 415540685 961986268 990569362 9656...
output:
62
result:
ok 1 number(s): "62"
Test #20:
score: 0
Accepted
time: 1811ms
memory: 4004kb
input:
1 1000000000 2000 983082198 998118377 133255920 610572950 206872860 997430403 184715228 358714182 577917083 618946695 457376242 788935995 213001254 402552678 805136885 901023068 230805393 394264451 647877612 836521262 260384310 990902247 409818531 847221384 791110001 876700979 380113193 775384241 98...
output:
68
result:
ok 1 number(s): "68"
Test #21:
score: 0
Accepted
time: 1906ms
memory: 4048kb
input:
1 1000000000 2000 866198326 984959665 577293370 619895730 40997921 614353847 619519915 762112999 653627047 934559654 836669385 838221693 150801344 848367607 172331400 524704520 514053116 611706075 816275630 945128934 552672251 875377371 924926041 974390075 958648050 977057013 388174710 757781221 867...
output:
65
result:
ok 1 number(s): "65"
Test #22:
score: 0
Accepted
time: 4ms
memory: 3756kb
input:
1 10 2000 3 10 7 9 9 10 4 9 9 10 10 10 5 10 5 8 9 9 8 8 2 8 2 9 4 9 1 4 4 8 7 8 1 3 9 10 5 7 7 9 7 10 5 8 2 7 8 9 2 10 5 6 8 9 4 5 8 8 7 10 7 10 10 10 6 7 5 10 7 10 9 10 1 4 3 6 9 9 7 9 8 9 3 9 3 5 8 10 3 6 3 9 3 10 3 9 4 6 9 10 4 8 4 9 8 10 1 2 10 10 8 9 2 7 5 5 4 6 7 7 1 3 1 5 2 6 8 9 1 8 8 8 8 9 ...
output:
10
result:
ok 1 number(s): "10"
Test #23:
score: 0
Accepted
time: 23ms
memory: 3788kb
input:
1 100 2000 72 77 22 100 39 72 24 62 16 60 72 79 10 83 25 73 65 80 25 52 66 69 59 62 40 64 23 49 52 52 9 29 10 77 98 99 54 69 13 17 40 61 4 21 49 91 24 71 40 96 33 97 81 99 75 99 45 62 34 56 44 96 15 21 18 63 73 81 35 98 97 100 3 8 54 71 14 67 89 91 69 78 54 63 55 82 26 99 21 97 87 89 19 86 47 80 5 3...
output:
53
result:
ok 1 number(s): "53"
Test #24:
score: 0
Accepted
time: 1750ms
memory: 4124kb
input:
1 1000000000 2000 269842809 342989075 757696397 836492119 283800102 368175835 822590805 872323042 941319254 945363554 281911546 293866204 38600498 86445775 480456857 512409031 93001458 142464233 444440343 481314857 199837475 390806080 247541526 359208697 91559247 103334865 843979563 922498813 219394...
output:
56
result:
ok 1 number(s): "56"
Test #25:
score: 0
Accepted
time: 1700ms
memory: 4100kb
input:
1 1000000000 2000 60970930 249531903 605655603 691131570 118119998 120991935 847802043 855924405 584102854 586717700 472229670 472514717 644930188 651241444 827728709 830128844 13795393 40329809 305610899 308346192 701926206 707118828 753530803 795196944 465598902 506244732 289441054 295066017 31306...
output:
48
result:
ok 1 number(s): "48"
Test #26:
score: 0
Accepted
time: 2169ms
memory: 4120kb
input:
1 1000000000 2000 536271720 567640349 500139615 505304625 983805617 983975201 94383607 147481725 660146910 669771610 383881741 388232026 270977785 281138547 732093947 763594417 916230529 918169865 840991913 842180384 148110570 190711924 234960944 320094883 471183646 473316949 589311548 599607524 843...
output:
36
result:
ok 1 number(s): "36"
Test #27:
score: 0
Accepted
time: 2191ms
memory: 4060kb
input:
1 1000000000 2000 253665547 265466414 680907838 683090293 624375234 634603777 122927162 123370400 796036172 809472081 44051418 53038658 805455233 813555754 598048351 601880671 890314580 907216922 71975295 73805827 210790640 215291615 7828762 11464474 755748 9933627 403981737 405251546 203053255 2073...
output:
29
result:
ok 1 number(s): "29"
Test #28:
score: 0
Accepted
time: 2450ms
memory: 4108kb
input:
1 1000000000 2000 405154724 415180094 217599764 236947592 443502690 445411390 704018773 736978289 411258264 417952279 74830932 83239763 549851687 550072757 78499713 79178089 386983274 389145943 904368883 908143439 573835921 579550046 461692563 462204357 737455142 749312955 201370027 208562823 800400...
output:
18
result:
ok 1 number(s): "18"
Test #29:
score: 0
Accepted
time: 2259ms
memory: 4048kb
input:
1 1000000000 2000 636241745 637184786 72054834 72845369 389843249 390664964 168145795 172118428 893106799 895704067 299524880 300801439 29663110 31018768 821696497 823269898 555248504 561118852 786551669 788495535 241984595 244010309 88896181 90154078 409626569 413026599 276562518 278971540 34098107...
output:
12
result:
ok 1 number(s): "12"
Test #30:
score: 0
Accepted
time: 2371ms
memory: 4040kb
input:
1 1000000000 2000 775300798 775887545 414455164 414765933 482698418 483451742 61950757 62192271 660326268 660527972 631032663 631204978 697002803 698108853 355102397 355611777 428369246 428537339 804557428 805328473 927694064 928207744 45269484 45777489 8814283 9209856 715864772 716035358 298335301 ...
output:
14
result:
ok 1 number(s): "14"
Test #31:
score: 0
Accepted
time: 2416ms
memory: 4068kb
input:
1 1000000000 2000 767922821 767991850 289504691 289531721 251731008 251917208 674093628 674196482 531956403 531991130 629214886 629249556 258581533 258771850 376924559 377133497 384702776 384846804 597904466 597997168 225891755 225975116 181703875 181793417 496608917 496630853 949582964 949591315 85...
output:
3
result:
ok 1 number(s): "3"
Test #32:
score: 0
Accepted
time: 2428ms
memory: 4052kb
input:
1 1000000000 2000 228893800 228908417 247092434 247118950 444005072 444005307 11611034 11617481 174532875 174543185 817918839 817922625 970187539 970190706 670081522 670119433 387831247 387855683 302583713 302586447 247247304 247256686 378883005 378894127 227362402 227363360 1961915 1971640 18341639...
output:
2
result:
ok 1 number(s): "2"
Test #33:
score: 0
Accepted
time: 2452ms
memory: 3952kb
input:
1 1000000000 2000 57718020 57719049 666380062 666380395 749991324 749991702 892182872 892183353 801943437 801944028 79294169 79294302 555724391 555726783 33922986 33924967 140433140 140433755 885613046 885614480 541055072 541055603 591953292 591956152 486054735 486054958 937249219 937249446 71466373...
output:
1
result:
ok 1 number(s): "1"
Test #34:
score: 0
Accepted
time: 203ms
memory: 3888kb
input:
20 1000000000 41 942725914 956893525 130968778 136999877 528516274 534235456 144476363 150040417 758242783 765399242 43829675 51184350 508202014 513231158 918241923 924218108 662727534 806406887 392873650 493267077 56851982 60477276 290204036 310321327 431216970 440055845 636193295 649883208 2731659...
output:
142606341 3 332748145 218365954 199648872 17 124780547 399297746 86803859 20 554580202 840358768 221832083 695746068 17 516947970 449758446 949942208 332748124 3
result:
ok 20 numbers
Test #35:
score: 0
Accepted
time: 292ms
memory: 3856kb
input:
10 1000000000 417 627781142 629714760 598651777 602008259 852433806 853778002 886286857 888427504 789562767 794791071 982787290 984372848 156909491 157679027 846484388 851062802 157686024 161849304 960912238 962168439 472530654 482013887 281175472 286597312 701329984 702139905 688522549 692226383 23...
output:
87056195 698771053 570425402 862120129 199648873 142606341 564225074 13 499122215 771370646
result:
ok 10 numbers
Test #36:
score: 0
Accepted
time: 2573ms
memory: 4112kb
input:
1 1000000000 2000 213239071 213382300 339117973 339530479 825361841 826092857 339970803 339980741 798713033 798740067 542540242 542736231 62765592 63346300 641000665 641054005 692199416 692257820 77404143 78416629 950702620 950907897 504833797 505142552 572971840 573068998 340559923 340656260 251909...
output:
390617398
result:
ok 1 number(s): "390617398"
Test #37:
score: 0
Accepted
time: 2457ms
memory: 4044kb
input:
1 1000000000 2000 883470303 883719058 823526735 823959348 713754093 713993403 506510792 507594225 13182808 13603988 648514473 648713042 130046376 131842867 601735303 602293659 626791988 626875924 880105881 880170880 656055622 656402411 770474419 770938733 454034089 454108708 227332224 227471558 5167...
output:
252429617
result:
ok 1 number(s): "252429617"
Test #38:
score: 0
Accepted
time: 2190ms
memory: 4016kb
input:
1 1000000000 2000 495216860 495381961 847680317 849382419 319281395 319333520 914985917 916233726 24433548 26044838 693088888 693983327 341755448 344295495 524313786 525774106 765723876 766023685 392333153 393124859 768866295 769238480 438757588 441413808 682278132 682966544 533511719 533562147 5131...
output:
413987627
result:
ok 1 number(s): "413987627"
Test #39:
score: 0
Accepted
time: 101ms
memory: 3892kb
input:
25 1000000000 67 123455062 138300052 682075564 709806147 870333599 888525646 694538258 709806147 174887939 215502420 329755066 365381755 248448357 305799318 340712517 386320187 451774220 460680050 503946421 583601959 743978171 772615965 772615966 807981577 196397842 217611956 540114475 601438711 248...
output:
2 6 3 6 1 5 3 4 1 3 4 4 3 2 2 3 4 3 3 17 3 3 4 3 3
result:
ok 25 numbers
Test #40:
score: 0
Accepted
time: 92ms
memory: 3900kb
input:
25 1000000000 8 451945203 650571474 210229324 391803744 199443037 633919031 451945203 527868201 313634017 527868201 527868202 592091043 161334809 248173054 464654287 551487286 1000000000 34 160357933 192487035 559925967 589526561 85962754 160357932 764363403 829367236 160357933 244074134 802842963 8...
output:
3 3 22 6 4 2 2 1 3 10 3 3 3 3 3 3 1 3 2 5 2 3 6 4 2
result:
ok 25 numbers
Test #41:
score: 0
Accepted
time: 76ms
memory: 3628kb
input:
25 1000000000 95 268285684 290209495 96424933 238536093 373212837 488855080 598938660 621949708 611427048 754296868 414662453 513035851 572592773 763500160 139170196 278255158 188749285 215748564 330135375 384326327 373212837 425487998 126153026 179775165 230132269 266488126 521213111 592697204 4455...
output:
6 4 5 7 3 5 5 6 4 4 5 4 2 6 4 5 5 5 4 6 5 6 4 8 4
result:
ok 25 numbers
Test #42:
score: 0
Accepted
time: 2447ms
memory: 4156kb
input:
1 1000000000 2000 225511530 225796647 552705123 553084865 538003589 543961013 16893155 17185605 778598634 779252377 354349842 354859429 446451287 447919642 419017572 419479842 893966872 894153449 257275199 258069702 499077695 499712882 472830003 473303563 428143098 429571576 352884258 353313406 6587...
output:
8
result:
ok 1 number(s): "8"
Test #43:
score: 0
Accepted
time: 1602ms
memory: 3968kb
input:
1 1000000000 2000 969241117 971535764 872503442 872893066 464210262 464294493 574466266 575860778 558718328 559264208 251274158 252247643 966111094 969241116 627585279 630533115 507332664 507758205 938271366 939363680 393507340 393948936 85691456 86650870 357680670 359218903 531543781 531575595 2183...
output:
4
result:
ok 1 number(s): "4"
Test #44:
score: 0
Accepted
time: 1609ms
memory: 3912kb
input:
1 1000000000 2000 751313598 753678238 322918113 334463509 759818237 767098526 531128289 537992021 927425047 931294215 680699101 681316759 538586906 546562997 317856129 321422652 973184123 974045540 324417001 327008551 275212591 285312470 340938422 341273619 677469503 686238480 226422829 232547044 20...
output:
7
result:
ok 1 number(s): "7"
Test #45:
score: 0
Accepted
time: 52ms
memory: 3604kb
input:
20 1000000000 76 906004140 989214514 19896379 235591036 848356160 989214514 763657765 816833327 585595932 624366340 303059589 569881455 439707762 569881455 344324756 431599130 275426294 341323002 123110164 322130243 149033180 275426293 342791702 763657764 963642799 977775987 115317773 175805856 8166...
output:
27 4 10 18 7 665496242 14 1 84 14 73 499122202 23 3 499122186 499122183 45 14 8 10
result:
ok 20 numbers
Test #46:
score: 0
Accepted
time: 125ms
memory: 3768kb
input:
10 1000000000 278 995452659 997548834 648198751 673191129 118677692 137028122 499299955 752624303 849543654 876041143 712696583 735698447 103396497 117291531 792261387 796443619 237709712 248667830 112951654 120573423 296332293 311968288 396739748 421398084 248391789 499299954 157198592 161589551 38...
output:
61 29 13 11 22 499122187 53 915057337 13 332748138
result:
ok 10 numbers
Test #47:
score: 0
Accepted
time: 957ms
memory: 4120kb
input:
1 1000000000 2000 317702002 318954968 843550691 843639136 298346563 302091448 328804521 329702425 463374305 464825019 725906849 726892719 186038168 186065320 475157821 475775952 632447082 633737428 915436778 925365582 160123752 160614471 745816250 749640744 949958510 951030236 633131086 634111700 40...
output:
890590564
result:
ok 1 number(s): "890590564"
Test #48:
score: 0
Accepted
time: 937ms
memory: 4120kb
input:
1 1000000000 2000 179833451 181845902 140720765 152523281 387089647 390236270 229324670 230765744 106379608 107244090 198895265 205329246 712412456 715201720 404429988 405809247 346184853 346855215 276682415 278408083 623546884 624444205 881177013 884518385 310209605 311816689 20051712 27003880 6553...
output:
184860075
result:
ok 1 number(s): "184860075"
Test #49:
score: 0
Accepted
time: 766ms
memory: 3940kb
input:
1 1000000000 2000 823478983 823804412 462643196 467900335 759432297 764966043 295652070 298825634 264236044 265236197 295328344 297721623 350560260 358292909 68580924 71114732 171342204 171756386 852811504 853974636 424232986 432674450 173920693 174262506 153900252 155844276 956748092 960354788 2419...
output:
84
result:
ok 1 number(s): "84"
Test #50:
score: 0
Accepted
time: 304ms
memory: 4052kb
input:
1 1000000000 2000 363507519 372817194 222654809 236209067 194306557 229482598 693996426 722519919 374848413 383228252 662340 2694939 377170601 397616788 247178097 264251864 961841390 973945991 663989675 669147478 669147479 683416580 738390664 773152410 612633797 625386647 559537836 618954307 5404370...
output:
183
result:
ok 1 number(s): "183"
Test #51:
score: 0
Accepted
time: 2339ms
memory: 4080kb
input:
1 1000000000 2000 132105117 132520278 434703333 434845607 306997743 307397976 978884416 978954174 392625991 394306655 225967678 226066906 138877397 139562516 821833754 823565157 381310053 381407704 628366575 631468184 420153941 421061040 367488948 367663707 641523083 641808024 144137716 145297760 61...
output:
6
result:
ok 1 number(s): "6"
Test #52:
score: 0
Accepted
time: 2011ms
memory: 4164kb
input:
1 1000000000 2000 521055885 523374854 274277208 275168763 451020472 451201389 33763812 34270637 220048387 220081345 812676035 813012164 917730432 918073715 664714618 664975141 142814720 143280321 933374160 933536760 714774849 717564321 211972305 212227491 333251954 333278754 726451569 727550058 9723...
output:
6
result:
ok 1 number(s): "6"
Test #53:
score: 0
Accepted
time: 2014ms
memory: 4116kb
input:
1 1000000000 2000 845739643 845895353 583412255 583565698 599606098 599772076 151406864 154520272 549830586 549905113 434407886 435605620 675513093 675569193 852778248 853851956 306299655 316611229 459537011 460232936 528059621 528640217 794250111 794750518 772608364 774086500 676812212 676873867 64...
output:
617960793
result:
ok 1 number(s): "617960793"
Test #54:
score: 0
Accepted
time: 2025ms
memory: 4052kb
input:
1 1000000000 2000 349519719 350037695 363222027 363359314 484007096 484195116 817433698 819286824 245731388 246132219 540577247 540671303 273883179 275307240 425841308 425926699 929034746 932177483 703185307 705982051 694043460 694627816 88504157 88550980 937521630 937843540 912193222 913339802 9186...
output:
812131002
result:
ok 1 number(s): "812131002"
Test #55:
score: 0
Accepted
time: 1824ms
memory: 4044kb
input:
1 1000000000 2000 852397916 852888998 452650401 452656589 907899398 909058230 475096227 475626797 905436233 906248983 555978385 556030990 571690900 572302037 99934701 100368967 405344978 405346228 216010865 222845509 594020526 594275374 992596237 993347869 453066793 453287668 445850923 445936870 532...
output:
735548473
result:
ok 1 number(s): "735548473"
Test #56:
score: 0
Accepted
time: 21ms
memory: 3644kb
input:
250 1000000000 4 465086424 609997778 10495745 465086423 236723947 253873205 253873206 663037010 1000000000 33 680743434 702491411 369564474 423049163 318395182 350987834 773067270 802087188 128739425 198037381 91200397 188498739 407323582 491446193 448144060 596279982 778512582 879710700 352166504 3...
output:
1 935854082 748683266 1 332748119 865145107 1 598946613 332748119 1 855638018 1 1 1 1 1 1 748683266 2 332748119 598946613 499122178 1 332748119 499122178 1 1 1 598946613 2 2 2 332748119 598946613 582309207 499122178 1 332748119 1 1 499122178 1 1 2 2 1 443664158 1 1 1 332748119 2 1 1 2 1 1 272248461 ...
result:
ok 250 numbers
Test #57:
score: 0
Accepted
time: 39ms
memory: 3664kb
input:
100 1000000000 27 61106800 120547680 249515432 436469696 23866584 65916585 242513397 378886240 130918283 202258454 778017547 831320344 423127198 447304856 448295746 500976275 23901488 56897783 434769186 463838309 710348599 777964751 910463995 916322804 219301130 255539839 712632164 820754977 2096836...
output:
460728164 2 332748119 1 855638018 2 2 2 1 1 332748119 1 1 1 291154604 598946613 1 598946613 1 1 480636171 510729670 968884226 855638018 1 2 748683266 1 1 1 1 1 1 1 1 332748119 499122178 1 1 1 2 1 499122178 2 299473307 105078354 1 1 1 1 1 1 166374060 2 1 1 1 1 1 1 865145107 460728164 332748119 748683...
result:
ok 100 numbers
Test #58:
score: 0
Accepted
time: 153ms
memory: 3760kb
input:
20 1000000000 41 473744613 513231158 649883209 688292341 51184351 100319435 840066787 931923883 290204036 349372918 16990073 36742999 942725914 956893525 446643401 474858723 771054201 864800317 2469432 56851981 165918255 233958647 765399243 806406887 440055846 465908250 43829675 60477276 114736716 1...
output:
149736654 1 308980396 68062116 1 1 865145107 510729670 1 1 1 54297811 1 1 1 405084666 1 890741116 1 1
result:
ok 20 numbers
Test #59:
score: 0
Accepted
time: 547ms
memory: 3820kb
input:
5 1000000000 161 427911765 439071547 926964534 948480727 367988821 378593295 87884650 96701374 704280091 722048989 811869468 821665842 633900319 647049003 339857817 349775203 479869921 490892495 491876149 508518307 181121365 186915301 752643864 772000342 366828778 371363614 245465353 262564191 40895...
output:
786117429 1 917358942 1 1
result:
ok 5 number(s): "786117429 1 917358942 1 1"
Test #60:
score: 0
Accepted
time: 1844ms
memory: 4316kb
input:
1 1000000000 1999 565505297 565901996 443733877 445080212 32093479 32858869 504501813 505011542 448441000 448945222 684093598 685388841 377416517 378022817 164058061 165421865 409146826 410722309 32773625 33332205 787201832 788330839 922718518 923635432 875883673 876966602 216190416 216309730 718682...
output:
822377481
result:
ok 1 number(s): "822377481"
Test #61:
score: 0
Accepted
time: 542ms
memory: 3768kb
input:
10 1000000000 73 906376711 911151795 722466929 731056785 327764585 329450736 1582200 10788578 406404228 410635453 841104935 853935267 624097330 634115368 5195381 45644846 272024175 294223602 440012577 447082433 731769294 766301661 202250761 228506379 649910244 679310930 690997892 716115123 972425941...
output:
124780546 2 3 3 499122181 8 499122178 3 499122179 8
result:
ok 10 numbers
Test #62:
score: 0
Accepted
time: 386ms
memory: 3740kb
input:
10 1000000000 360 117357741 122642768 652746675 653628811 33038642 35336679 943041534 958480862 534215049 535664791 4821495 8399150 822235089 822871725 388120082 389427217 873898234 874681809 914954460 917085713 291653986 291996602 917854573 919999050 191974421 192913895 875064619 875709677 94110903...
output:
4 54 3 898419920 181498977 499122210 62 499122184 499122178 213909507
result:
ok 10 numbers
Test #63:
score: 0
Accepted
time: 299ms
memory: 3852kb
input:
10 1000000000 417 627782159 629714418 598652339 602004634 852435669 853776364 886286944 888423308 789571247 794789583 982790616 984372314 156909693 157678776 846486916 851057546 157702847 161844603 960912298 962167808 472530741 482012489 281184226 286594181 701330342 702139882 688524187 692226145 23...
output:
604996579 97867096 933841501 249561100 582309212 499122196 739440263 34 279508421 6
result:
ok 10 numbers
Test #64:
score: 0
Accepted
time: 808ms
memory: 3940kb
input:
5 1000000000 161 829875444 830340246 369526321 414573552 704280157 706935249 899173955 948207545 923786691 926963593 417014935 419112724 138773846 140524779 898770449 899144427 42838360 104420262 576144490 618664537 671421911 675138791 284707382 292581856 838355156 840885856 220622392 223502124 2746...
output:
6 911440498 425952435 798595485 145199181
result:
ok 5 number(s): "6 911440498 425952435 798595485 145199181"
Test #65:
score: 0
Accepted
time: 778ms
memory: 3760kb
input:
5 1000000000 79 202295082 249510473 909929300 920764523 168459007 208978707 858783623 887054028 712835511 713697916 440751377 447554391 669251696 696097547 202575434 219549223 555743166 600258234 718411712 746444094 577267370 604947222 568398016 575580445 73785241 83033948 45886396 66164737 59423823...
output:
748683266 499122178 2 7 2
result:
ok 5 number(s): "748683266 499122178 2 7 2"
Test #66:
score: 0
Accepted
time: 2359ms
memory: 4116kb
input:
1 1000000000 2000 453728840 453871359 136528591 136599754 907425953 907556932 890377910 890555413 186058841 189834044 498857680 498951473 134321254 134528543 218185241 222650036 831015457 831275262 994724250 994819259 831519675 834140578 443260314 443310021 376300744 376360461 119404417 119407103 75...
output:
809387319
result:
ok 1 number(s): "809387319"
Test #67:
score: 0
Accepted
time: 2568ms
memory: 4120kb
input:
1 1000000000 2000 490107004 490265827 715134355 715138889 446734983 447079069 936477132 936479770 212487061 212540055 498917927 498921361 348117615 348520607 40147923 40226577 256411096 256413554 694137275 694174287 811326155 811334614 417299982 417388584 873728288 873776423 948967853 948989326 3738...
output:
5
result:
ok 1 number(s): "5"
Test #68:
score: -100
Time Limit Exceeded
input:
1 1000000000 2000 787413297 787605968 476274200 476684803 816016084 816647436 189892695 190360669 103076030 103146283 649097093 653620756 451324438 451367853 380492694 380852958 396834624 396933168 100826692 100941186 485349940 486382963 900819667 901255051 672079397 676789912 256477863 256772369 51...