QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#712784 | #9563. 人间应又雪 | cmk666 | 100 ✓ | 610ms | 40476kb | C++23 | 11.8kb | 2024-11-05 17:01:42 | 2024-11-05 17:01:42 |
Judging History
answer
/* _ _ _ _ __ __ __
/ \ _ _ | |_ | |__ ___ _ __ _ ___ _ __ ___ | | __ / /_ / /_ / /_
/ _ \ | | | | | __| | '_ \ / _ \ | '__| (_) / __| | '_ ` _ \ | |/ / | '_ \ | '_ \ | '_ \
/ ___ \ | |_| | | |_ | | | | | (_) | | | _ | (__ | | | | | | | < | (_) | | (_) | | (_) |
/_/ \_\ \__,_| \__| |_| |_| \___/ |_| (_) \___| |_| |_| |_| |_|\_\ \___/ \___/ \___/
[Created Time: 2024-11-05 16:30:25]
[Last Modified Time: 2024-11-05 17:01:28] */
#ifdef LOCAL
#include<bits/stdc++.h>
#include"debug.h"
#else
#pragma GCC optimize("Ofast", "unroll-loops")
#include<bits/stdc++.h>
#define D(...) ((void)0)
#endif
using namespace std; using ll = long long;
#define For(i, j, k) for ( int i = (j) ; i <= (k) ; i++ )
#define Fol(i, j, k) for ( int i = (j) ; i >= (k) ; i-- )
namespace FastIO
{
#define USE_FastIO
// ------------------------------
// #define DISABLE_MMAP
// ------------------------------
#if ( defined(LOCAL) || defined(_WIN32) ) && !defined(DISABLE_MMAP)
#define DISABLE_MMAP
#endif
#ifdef LOCAL
inline void _chk_i() {}
inline char _gc_nochk() { return getchar(); }
inline char _gc() { return getchar(); }
inline void _chk_o() {}
inline void _pc_nochk(char c) { putchar(c); }
inline void _pc(char c) { putchar(c); }
template < int n > inline void _pnc_nochk(const char *c) { for ( int i = 0 ; i < n ; i++ ) putchar(c[i]); }
#else
#ifdef DISABLE_MMAP
inline constexpr int _READ_SIZE = 1 << 18; inline static char _read_buffer[_READ_SIZE + 40], *_read_ptr = nullptr, *_read_ptr_end = nullptr; static inline bool _eof = false;
inline void _chk_i() { if ( __builtin_expect(!_eof, true) && __builtin_expect(_read_ptr_end - _read_ptr < 40, false) ) { int sz = _read_ptr_end - _read_ptr; if ( sz ) memcpy(_read_buffer, _read_ptr, sz); char *beg = _read_buffer + sz; _read_ptr = _read_buffer, _read_ptr_end = beg + fread(beg, 1, _READ_SIZE, stdin); if ( __builtin_expect(_read_ptr_end != beg + _READ_SIZE, false) ) _eof = true, *_read_ptr_end = EOF; } }
inline char _gc_nochk() { return __builtin_expect(_eof && _read_ptr == _read_ptr_end, false) ? EOF : *_read_ptr++; }
inline char _gc() { _chk_i(); return _gc_nochk(); }
#else
#include<sys/mman.h>
#include<sys/stat.h>
inline static char *_read_ptr = (char *)mmap(nullptr, [] { struct stat s; return fstat(0, &s), s.st_size; } (), 1, 2, 0, 0);
inline void _chk_i() {}
inline char _gc_nochk() { return *_read_ptr++; }
inline char _gc() { return *_read_ptr++; }
#endif
inline constexpr int _WRITE_SIZE = 1 << 18; inline static char _write_buffer[_WRITE_SIZE + 40], *_write_ptr = _write_buffer;
inline void _chk_o() { if ( __builtin_expect(_write_ptr - _write_buffer > _WRITE_SIZE, false) ) fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout), _write_ptr = _write_buffer; }
inline void _pc_nochk(char c) { *_write_ptr++ = c; }
inline void _pc(char c) { *_write_ptr++ = c, _chk_o(); }
template < int n > inline void _pnc_nochk(const char *c) { memcpy(_write_ptr, c, n), _write_ptr += n; }
inline struct _auto_flush { inline ~_auto_flush() { fwrite(_write_buffer, 1, _write_ptr - _write_buffer, stdout); } } _auto_flush;
#endif
#define println println_ // don't use C++23 std::println
template < class T > inline constexpr bool _is_signed = numeric_limits < T >::is_signed;
template < class T > inline constexpr bool _is_unsigned = numeric_limits < T >::is_integer && !_is_signed < T >;
#if __SIZEOF_LONG__ == 64
template <> inline constexpr bool _is_signed < __int128 > = true;
template <> inline constexpr bool _is_unsigned < __uint128_t > = true;
#endif
inline bool _isgraph(char c) { return c >= 33; }
inline bool _isdigit(char c) { return 48 <= c && c <= 57; } // or faster, remove c <= 57
constexpr struct _table {
#ifndef LOCAL
int i[65536];
#endif
char o[40000]; constexpr _table() :
#ifndef LOCAL
i{},
#endif
o{} {
#ifndef LOCAL
for ( int x = 0 ; x < 65536 ; x++ ) i[x] = -1; for ( int x = 0 ; x <= 9 ; x++ ) for ( int y = 0 ; y <= 9 ; y++ ) i[x + y * 256 + 12336] = x * 10 + y;
#endif
for ( int x = 0 ; x < 10000 ; x++ ) for ( int y = 3, z = x ; ~y ; y-- ) o[x * 4 + y] = z % 10 + 48, z /= 10; } } _table;
template < class T, int digit > inline constexpr T _pw10 = 10 * _pw10 < T, digit - 1 >;
template < class T > inline constexpr T _pw10 < T, 0 > = 1;
inline void read(char &c) { do c = _gc(); while ( !_isgraph(c) ); }
inline void read_cstr(char *s) { char c = _gc(); while ( !_isgraph(c) ) c = _gc(); while ( _isgraph(c) ) *s++ = c, c = _gc(); *s = 0; }
inline void read(string &s) { char c = _gc(); s.clear(); while ( !_isgraph(c) ) c = _gc(); while ( _isgraph(c) ) s.push_back(c), c = _gc(); }
template < class T, bool neg >
#ifndef LOCAL
__attribute__((no_sanitize("undefined")))
#endif
inline void _read_int_suf(T &x) { _chk_i(); char c; while
#ifndef LOCAL
( ~_table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)] ) if constexpr ( neg ) x = x * 100 - _table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)++]; else x = x * 100 + _table.i[*reinterpret_cast < unsigned short *& >(_read_ptr)++]; if
#endif
( _isdigit(c = _gc_nochk()) ) if constexpr ( neg ) x = x * 10 - ( c & 15 ); else x = x * 10 + ( c & 15 ); }
template < class T, enable_if_t < _is_signed < T >, int > = 0 > inline void read(T &x) { char c; while ( !_isdigit(c = _gc()) ) if ( c == 45 ) { _read_int_suf < T, true >(x = -( _gc_nochk() & 15 )); return; } _read_int_suf < T, false >(x = c & 15); }
template < class T, enable_if_t < _is_unsigned < T >, int > = 0 > inline void read(T &x) { char c; while ( !_isdigit(c = _gc()) ); _read_int_suf < T, false >(x = c & 15); }
inline void write(bool x) { _pc(x | 48); }
inline void write(char c) { _pc(c); }
inline void write_cstr(const char *s) { while ( *s ) _pc(*s++); }
inline void write(const string &s) { for ( char c : s ) _pc(c); }
template < class T, bool neg, int digit > inline void _write_int_suf(T x) { if constexpr ( digit == 4 ) _pnc_nochk < 4 >(_table.o + ( neg ? -x : x ) * 4); else _write_int_suf < T, neg, digit / 2 >(x / _pw10 < T, digit / 2 >), _write_int_suf < T, neg, digit / 2 >(x % _pw10 < T, digit / 2 >); }
template < class T, bool neg, int digit > inline void _write_int_pre(T x) { if constexpr ( digit <= 4 ) if ( digit >= 3 && ( neg ? x <= -100 : x >= 100 ) ) if ( digit >= 4 && ( neg ? x <= -1000 : x >= 1000 ) ) _pnc_nochk < 4 >(_table.o + ( neg ? -x : x ) * 4); else _pnc_nochk < 3 >(_table.o + ( neg ? -x : x ) * 4 + 1); else if ( digit >= 2 && ( neg ? x <= -10 : x >= 10 ) ) _pnc_nochk < 2 >(_table.o + ( neg ? -x : x ) * 4 + 2); else _pc_nochk(( neg ? -x : x ) | 48); else { constexpr int cur = 1 << __lg(digit - 1); if ( neg ? x <= -_pw10 < T, cur > : x >= _pw10 < T, cur > ) _write_int_pre < T, neg, digit - cur >(x / _pw10 < T, cur >), _write_int_suf < T, neg, cur >(x % _pw10 < T, cur >); else _write_int_pre < T, neg, cur >(x); } }
template < class T, enable_if_t < _is_signed < T >, int > = 0 > inline void write(T x) { if ( x >= 0 ) _write_int_pre < T, false, numeric_limits < T >::digits10 + 1 >(x); else _pc_nochk(45), _write_int_pre < T, true, numeric_limits < T >::digits10 + 1 >(x); _chk_o(); }
template < class T, enable_if_t < _is_unsigned < T >, int > = 0 > inline void write(T x) { _write_int_pre < T, false, numeric_limits < T >::digits10 + 1 >(x), _chk_o(); }
template < size_t N, class ...T > inline void _read_tuple(tuple < T... > &x) { read(get < N >(x)); if constexpr ( N + 1 != sizeof...(T) ) _read_tuple < N + 1, T... >(x); }
template < size_t N, class ...T > inline void _write_tuple(const tuple < T... > &x) { write(get < N >(x)); if constexpr ( N + 1 != sizeof...(T) ) _pc(32), _write_tuple < N + 1, T... >(x); }
template < class ...T > inline void read(tuple < T... > &x) { _read_tuple < 0, T... >(x); }
template < class ...T > inline void write(const tuple < T... > &x) { _write_tuple < 0, T... >(x); }
template < class T1, class T2 > inline void read(pair < T1, T2 > &x) { read(x.first), read(x.second); }
template < class T1, class T2 > inline void write(const pair < T1, T2 > &x) { write(x.first), _pc(32), write(x.second); }
template < class T > inline auto read(T &x) -> decltype(x.read(), void()) { x.read(); }
template < class T > inline auto write(const T &x) -> decltype(x.write(), void()) { x.write(); }
template < class T1, class ...T2 > inline void read(T1 &x, T2 &...y) { read(x), read(y...); }
template < class ...T > inline void read_cstr(char *x, T *...y) { read_cstr(x), read_cstr(y...); }
template < class T1, class ...T2 > inline void write(const T1 &x, const T2 &...y) { write(x), write(y...); }
template < class ...T > inline void write_cstr(const char *x, const T *...y) { write_cstr(x), write_cstr(y...); }
template < class T > inline void print(const T &x) { write(x); }
inline void print_cstr(const char *x) { write_cstr(x); }
template < class T1, class ...T2 > inline void print(const T1 &x, const T2 &...y) { write(x), _pc(32), print(y...); }
template < class ...T > inline void print_cstr(const char *x, const T *...y) { write_cstr(x), _pc(32), print_cstr(y...); }
inline void println() { _pc(10); }
inline void println_cstr() { _pc(10); }
template < class ...T > inline void println(const T &...x) { print(x...), _pc(10); }
template < class ...T > inline void println_cstr(const T *...x) { print_cstr(x...), _pc(10); }
} using FastIO::read, FastIO::read_cstr, FastIO::write, FastIO::write_cstr, FastIO::println, FastIO::println_cstr;
namespace BIT
{
using T = int; int n; T c[500009];
inline void init(int x) { n = x, fill(c + 1, c + n + 1, 0); }
inline void add(int x, T y) { for ( ; x <= n ; x += x & -x ) c[x] += y; }
// inline T qry(int x) { T y = 0; for ( ; x ; x ^= x & -x ) y += c[x]; return y; }
// inline T qry(int x, int y) { return qry(y) - qry(x - 1); }
inline int kth(int x)
{
int y = 0; T z = 0;
Fol(i, 18, 0) if ( ( y | ( 1 << i ) ) <= n && z + c[y | ( 1 << i )] < x )
z += c[y |= 1 << i];
return y + 1;
}
}
int n, m, cc, a[500009], b[500009], l, r, md, pl[500009], pr[500009], cl[500009], cr[500009];
int o, p, q, fa[500009], pre[500009], lenl, lenr; bool used[500009];
tuple < int, int, int > dell[500009], delr[500009];
inline void init(int *a, auto *del, int &len)
{
iota(pre, pre + m + 2, -1), o = m + 1, len = 0, BIT::init(m);
For(i, 1, m) BIT::add(i, 1);
For(i, 1, n) for ( int j = m + 1 - a[i] ; j < o ; del[++len] = tuple(i, p, q), j += cc, o-- )
p = m + 1 - BIT::kth(j), q = pre[p], pre[p] = pre[q], BIT::add(m + 1 - q, -1), D(p, q);
}
inline void calc(int x, int *a, auto *del, int len, int *p, int *c)
{
fill(used, used + x + 1, false), fill(used + x + 1, used + m + 1, true),
iota(fa, fa + x + 1, 0), iota(pre, pre + x + 2, -1), q = 1;
For(i, 1, n)
{
o = 0;
for ( int &j = pre[x + 1] ; ~j && o * cc + x < a[i] ; j = pre[j] )
p[j] = i, c[j] = o++, used[j] = true;
for ( ; q <= len && get<0>(del[q]) == i ; q++ )
if ( !used[get<1>(del[q])] && !used[get<2>(del[q])] )
pre[get<1>(del[q])] = pre[get<2>(del[q])], fa[get<2>(del[q])] = get<1>(del[q]);
}
for ( int i = pre[x + 1] ; ~i ; i = pre[i] ) p[i] = n + 1;
Fol(i, x, 0) p[i] = p[fa[i]], c[i] = c[fa[i]];
}
inline bool chk(int x)
{
calc(x, a, dell, lenl, pl, cl), calc(x, b, delr, lenr, pr, cr);
For(i, 0, x) pr[i] = n + 1 - pr[i];
For(i, 0, x) if ( pl[i] > pr[x - i] || ( pl[i] == pr[x - i] &&
x + cc * ( cl[i] + cr[x - i] ) >= a[pl[i]] ) ) return true;
return false;
}
inline void work()
{
read(n, m, cc);
For(i, 1, n) read(a[i]), b[n - i + 1] = a[i];
init(a, dell, lenl), init(b, delr, lenr);
for ( l = 0, r = m ; l < r ; ) chk(md = ( l + r ) >> 1) ? r = md : l = md + 1;
println(l);
}
int main() { int _, t; read(t, _); For(tt, 1, t) work(); return 0; }
// 想上GM捏 想上GM捏 想上GM捏 想上GM捏 想上GM捏
// 伊娜可爱捏 伊娜贴贴捏
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 2
Accepted
Test #1:
score: 2
Accepted
time: 0ms
memory: 22156kb
input:
1000 1 9 8 0 8 5 2 1 6 4 5 1 5 9 8 0 1 7 3 2 0 8 5 1 0 8 9 0 3 8 7 3 2 4 9 9 8 9 0 8 3 9 3 9 8 3 4 9 10 0 0 9 5 5 4 3 6 10 5 8 8 0 3 5 1 6 8 4 2 5 8 9 0 5 2 3 8 1 4 2 9 10 8 0 2 8 2 3 1 7 0 1 5 1 8 9 0 1 0 4 9 9 5 7 2 9 10 0 3 4 0 10 0 9 6 7 0 8 9 0 4 8 4 4 0 4 2 3 9 8 0 0 5 2 3 1 0 4 0 0 10 10 0 3 ...
output:
8 8 9 9 10 8 9 8 9 10 8 5 10 9 8 8 7 10 8 10 8 10 9 8 10 6 10 8 8 6 7 8 9 7 9 8 8 8 5 8 9 10 5 8 10 8 10 7 9 9 9 8 8 7 9 9 8 9 8 8 7 8 8 7 10 9 10 9 9 8 8 9 7 8 9 7 7 9 6 10 8 7 8 8 9 9 9 9 9 8 8 5 7 8 8 9 6 8 8 9 8 9 8 9 9 10 8 9 8 8 7 8 7 8 7 7 7 10 9 10 9 9 8 9 8 10 10 8 7 10 8 10 8 8 8 7 10 10 8...
result:
ok 1000 lines
Test #2:
score: 2
Accepted
time: 326ms
memory: 40204kb
input:
2 1 499998 499999 0 301138 174092 254294 217002 447568 498904 49075 373725 308244 252462 370947 392908 319430 488362 86682 68848 435192 169516 29640 369208 128139 213960 159766 44498 322235 240582 283451 176399 270410 120552 173820 121114 197080 354767 283489 398040 13031 432699 251631 352577 264788...
output:
499999 499997
result:
ok 2 lines
Subtask #2:
score: 3
Accepted
Test #3:
score: 3
Accepted
time: 3ms
memory: 22148kb
input:
1000 2 10 2 3 1 2 1 2 1 2 2 1 0 1 10 2 0 0 0 0 0 0 0 0 0 0 0 10 2 3 0 0 1 1 0 1 0 0 0 1 10 2 3 0 0 0 0 0 0 0 0 0 0 10 2 1 1 0 2 2 0 0 1 0 1 1 10 2 3 0 1 1 0 2 0 1 2 2 2 10 2 0 0 0 0 0 0 0 0 0 0 0 10 2 0 0 0 0 1 1 1 0 0 0 1 10 2 1 1 1 0 2 0 0 0 0 0 0 10 2 1 1 1 2 0 0 2 0 2 1 0 10 2 1 0 0 0 0 0 0 0 0 ...
output:
2 0 1 0 2 2 0 1 1 2 0 1 0 1 0 0 2 2 0 0 2 0 1 2 1 1 2 0 2 1 0 0 2 1 0 1 2 1 0 1 2 2 2 0 1 2 1 2 2 2 1 2 2 2 1 0 1 2 2 1 0 1 0 1 0 2 2 2 2 2 0 1 2 2 2 2 1 2 2 1 2 0 0 1 2 2 1 2 2 1 0 2 2 2 1 0 0 0 1 2 0 2 2 0 0 2 2 0 2 2 0 1 1 2 0 0 1 2 1 2 1 2 2 2 1 1 2 0 0 2 2 0 2 2 2 0 2 1 1 0 2 2 2 2 0 0 1 0 0 1 ...
result:
ok 1000 lines
Test #4:
score: 3
Accepted
time: 0ms
memory: 20392kb
input:
100 2 1000 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
0 1 1 2 1 0 1 1 2 0 0 0 0 0 0 1 0 2 2 2 1 2 1 1 1 2 2 2 0 2 1 1 2 0 0 1 2 0 0 0 0 2 2 2 1 1 2 2 0 0 2 1 2 1 2 2 0 2 0 0 0 2 2 0 2 0 0 2 1 2 1 2 0 1 0 2 1 1 2 2 2 2 2 2 0 2 2 1 2 2 0 1 2 1 1 0 0 0 0 2
result:
ok 100 lines
Test #5:
score: 3
Accepted
time: 3ms
memory: 24144kb
input:
2 2 500000 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
1 2
result:
ok 2 lines
Subtask #3:
score: 5
Accepted
Test #6:
score: 5
Accepted
time: 3ms
memory: 22100kb
input:
10 3 5 5 3 4 1 5 1 4 4 5 4 2 2 3 4 5 5 0 1 1 5 3 4 4 4 2 2 1 0 1 3 5 3 0 2 3 5 4 2 3 2 4 1 4 3 4 4 3 2 2 3 4 5 4 0 2 3 5 3 1 0 5 5 4 0 2 0 4 1 3
output:
3 2 5 1 2 3 2 2 2 4
result:
ok 10 lines
Test #7:
score: 5
Accepted
time: 0ms
memory: 20072kb
input:
10 3 5 5 4 2 2 1 0 0 5 5 5 5 3 1 0 1 5 5 5 0 3 2 0 0 5 5 1 1 5 2 5 2 5 5 3 4 5 0 1 5 5 5 5 2 3 3 4 3 5 5 4 5 4 5 2 5 5 5 1 3 0 2 2 3 5 5 5 1 3 1 1 4 5 5 3 1 3 4 5 1
output:
2 2 2 4 3 3 4 2 2 3
result:
ok 10 lines
Test #8:
score: 5
Accepted
time: 2ms
memory: 22136kb
input:
10 3 5 5 4 1 5 2 2 1 5 5 5 0 1 1 1 4 5 5 2 1 1 2 3 4 5 5 3 1 3 5 4 2 5 5 5 1 1 5 4 3 5 5 5 0 3 4 4 5 5 5 1 0 0 1 2 5 5 5 3 0 0 1 2 4 5 5 3 3 5 3 3 3 5 5 4 2 5 5 4 3
output:
2 1 3 3 3 3 3 2 3 4
result:
ok 10 lines
Test #9:
score: 5
Accepted
time: 0ms
memory: 22176kb
input:
10 3 5 5 5 5 3 2 1 1 5 5 4 3 3 1 2 2 5 5 4 5 5 4 0 1 5 5 4 5 4 4 0 0 5 5 4 5 3 3 1 0 5 5 1 4 2 2 3 4 5 5 2 4 3 3 2 1 5 5 3 5 2 2 1 1 5 5 3 5 4 3 3 0 5 5 4 5 1 1 2 4
output:
2 2 3 3 3 3 3 2 3 2
result:
ok 10 lines
Test #10:
score: 5
Accepted
time: 3ms
memory: 22152kb
input:
10 3 5 5 2 4 2 4 4 5 5 5 1 2 0 2 3 4 5 5 2 2 5 4 1 1 5 5 3 1 5 5 5 5 5 5 5 5 1 1 5 3 5 5 5 3 3 5 1 5 5 5 1 3 4 1 3 2 5 5 5 5 5 5 2 2 5 5 4 5 5 1 1 5 5 5 5 5 5 2 2 5
output:
4 3 3 4 3 3 3 3 3 3
result:
ok 10 lines
Test #11:
score: 5
Accepted
time: 0ms
memory: 22184kb
input:
10 3 5 5 1 5 5 3 5 1 5 5 3 0 0 4 1 1 5 5 5 5 1 1 1 1 5 5 4 5 1 1 5 0 5 5 1 0 2 1 5 5 5 5 5 1 1 5 1 1 5 5 3 2 5 0 0 0 5 5 1 3 3 5 0 0 5 5 3 2 2 5 4 0 5 5 5 0 5 1 1 1
output:
4 1 1 2 4 2 2 3 2 1
result:
ok 10 lines
Test #12:
score: 5
Accepted
time: 3ms
memory: 22116kb
input:
10 3 5 5 2 5 5 4 5 4 5 5 1 5 5 5 5 4 5 5 3 4 4 4 5 5 5 5 5 4 4 5 5 4 5 5 5 5 4 5 4 4 5 5 1 5 4 4 5 4 5 5 4 4 4 5 5 5 5 5 3 4 5 5 5 4 5 5 2 5 5 5 4 5 5 5 4 4 4 4 5 5
output:
4 5 4 4 4 4 4 4 5 4
result:
ok 10 lines
Subtask #4:
score: 10
Accepted
Dependency #3:
100%
Accepted
Test #13:
score: 10
Accepted
time: 0ms
memory: 22184kb
input:
20 4 9 10 9 10 4 9 10 0 4 9 10 8 9 9 1 8 7 3 6 1 8 6 3 9 10 8 4 3 3 4 4 8 4 7 0 0 0 9 8 9 5 1 3 6 6 2 2 6 3 8 8 5 6 0 4 1 4 0 4 4 8 10 8 5 7 6 5 6 1 8 7 10 10 1 5 4 5 4 0 4 10 9 7 8 8 9 9 2 3 0 5 2 1 5 1 8 10 5 10 8 9 9 2 10 1 10 9 10 3 3 4 3 6 7 3 5 1 5 8 8 10 1 0 2 0 0 0 7 5 9 8 9 2 4 8 6 4 4 5 1 ...
output:
6 7 4 5 4 6 8 3 7 5 2 5 5 6 4 5 5 6 4 5
result:
ok 20 lines
Test #14:
score: 10
Accepted
time: 2ms
memory: 20192kb
input:
4 4 50 50 2 27 29 4 40 18 13 32 22 48 50 46 38 9 45 3 22 41 35 24 33 23 15 11 1 39 2 33 44 20 22 35 17 26 31 35 49 21 22 13 46 30 3 44 21 40 1 28 3 50 5 50 50 1 6 15 26 15 20 9 43 13 17 17 44 19 10 44 48 15 20 32 22 6 38 5 33 37 26 23 50 17 19 15 18 35 39 32 12 36 50 0 1 39 23 46 43 12 8 0 48 28 46 ...
output:
45 48 45 46
result:
ok 4 lines
Test #15:
score: 10
Accepted
time: 0ms
memory: 22316kb
input:
4 4 50 50 27 0 2 2 3 3 5 6 6 6 6 6 7 7 7 10 12 13 14 16 19 21 21 22 23 24 25 26 49 49 49 49 48 48 45 42 41 40 39 38 37 36 36 36 35 34 34 33 33 33 32 50 50 8 1 3 4 4 5 7 7 7 8 9 10 10 11 12 12 13 14 15 15 16 18 19 20 22 23 25 25 26 27 28 29 30 30 30 32 32 34 36 36 36 37 41 41 41 42 43 43 43 45 47 50 ...
output:
26 34 41 32
result:
ok 4 lines
Test #16:
score: 10
Accepted
time: 2ms
memory: 22244kb
input:
4 4 50 50 16 49 47 45 45 42 41 40 40 39 39 0 1 1 1 2 2 4 5 6 10 12 13 14 16 16 18 18 18 19 20 24 26 26 26 27 27 30 31 32 32 33 34 34 35 35 36 36 38 38 38 50 50 10 49 48 47 44 42 42 42 41 41 40 40 38 36 34 34 33 32 31 31 29 28 28 27 27 26 26 25 25 23 21 19 18 16 16 16 15 14 14 0 2 4 4 6 6 7 7 7 8 11 ...
output:
31 34 35 31
result:
ok 4 lines
Test #17:
score: 10
Accepted
time: 0ms
memory: 22184kb
input:
4 4 50 50 18 16 34 15 50 15 34 16 16 16 16 35 17 35 16 16 16 50 36 18 18 18 36 36 18 50 35 17 50 16 34 15 15 15 15 15 34 34 15 15 15 15 15 50 34 35 35 50 32 32 14 50 50 2 6 6 8 5 5 5 5 5 5 5 5 5 5 5 5 5 8 6 6 6 6 6 6 9 7 7 7 7 7 7 11 8 6 6 6 8 7 4 4 4 4 4 4 4 4 4 4 6 3 3 50 50 6 0 0 0 0 0 0 0 0 7 1 ...
output:
29 9 1 38
result:
ok 4 lines
Test #18:
score: 10
Accepted
time: 3ms
memory: 20140kb
input:
4 4 50 50 2 6 6 6 12 8 8 8 8 8 8 8 8 8 13 8 8 8 18 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 50 50 18 5 5 5 5 5 5 5 5 5 5 50 23 23 23 23 23 23 23 23 23 23 23 23 23 23 50 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 50 50 1 14 14 14 14 14 14 14 14 14 1...
output:
9 26 17 30
result:
ok 4 lines
Test #19:
score: 10
Accepted
time: 0ms
memory: 22184kb
input:
4 4 50 50 46 49 50 49 50 50 50 49 50 49 50 49 49 49 50 49 50 49 50 49 50 50 50 50 50 49 50 50 50 49 49 49 50 49 49 49 50 49 49 50 49 49 50 50 50 50 49 50 49 50 49 50 50 11 50 50 49 50 50 49 49 49 50 49 50 49 50 49 50 50 49 50 50 49 50 50 49 49 50 50 50 49 49 49 49 49 49 49 49 49 49 49 50 49 49 50 49...
output:
49 50 49 49
result:
ok 4 lines
Subtask #5:
score: 10
Accepted
Dependency #4:
100%
Accepted
Test #20:
score: 10
Accepted
time: 0ms
memory: 22208kb
input:
30 5 20 18 2 11 1 4 8 18 16 15 13 13 10 3 4 5 9 10 11 2 4 4 8 19 20 0 6 17 17 15 3 16 2 8 7 11 0 14 14 6 12 15 19 2 9 19 20 10 19 10 0 7 14 8 5 7 20 4 10 16 9 3 5 10 12 4 3 18 20 4 8 9 17 0 1 15 15 4 12 13 10 12 8 17 17 16 18 6 19 18 10 17 1 17 10 0 5 13 5 16 12 8 18 0 8 12 12 5 3 9 20 19 3 16 6 17 ...
output:
13 19 10 13 11 15 15 14 15 13 10 11 18 20 13 11 12 10 11 20 10 12 14 12 18 15 13 14 11 11
result:
ok 30 lines
Test #21:
score: 10
Accepted
time: 2ms
memory: 22180kb
input:
3 5 200 200 18 76 132 130 37 139 121 171 152 22 23 194 5 181 174 96 3 71 109 143 20 144 114 157 195 109 99 120 132 110 50 101 103 37 186 71 193 157 22 65 136 84 96 123 13 154 26 66 161 200 60 93 45 48 137 18 81 77 45 37 145 100 57 130 54 20 38 28 135 16 132 85 6 18 117 26 129 57 172 10 7 198 152 26 ...
output:
157 135 131
result:
ok 3 lines
Test #22:
score: 10
Accepted
time: 2ms
memory: 22240kb
input:
2 5 300 300 52 0 1 2 2 4 6 7 7 9 10 10 11 12 12 12 13 14 14 17 18 21 21 23 24 24 24 24 24 24 26 26 26 27 29 32 32 33 33 36 37 37 39 39 40 40 40 41 42 43 44 45 46 46 47 47 47 50 50 51 53 54 54 57 57 57 60 65 65 66 71 72 72 74 74 74 74 75 75 75 78 80 81 81 81 82 82 83 83 84 85 86 91 91 93 93 94 94 94 ...
output:
217 189
result:
ok 2 lines
Test #23:
score: 10
Accepted
time: 0ms
memory: 22240kb
input:
2 5 300 300 2 300 299 299 299 299 298 298 297 289 289 288 288 286 286 286 286 285 284 283 282 280 279 279 278 278 278 276 275 275 275 275 274 274 273 273 272 271 270 270 270 266 265 264 262 261 260 259 257 257 256 256 254 254 251 249 249 245 244 244 244 240 236 236 236 234 233 233 227 227 227 226 22...
output:
289 204
result:
ok 2 lines
Test #24:
score: 10
Accepted
time: 2ms
memory: 20208kb
input:
2 5 300 300 12 46 34 34 34 34 47 35 35 48 49 37 61 35 35 35 35 35 35 47 34 47 35 35 48 36 36 36 36 36 36 36 36 49 37 50 38 38 38 38 38 38 38 38 38 38 38 38 38 38 51 39 39 39 39 39 39 52 40 40 40 40 40 40 40 53 41 41 41 41 41 41 41 41 66 41 54 42 42 42 54 41 41 53 40 40 40 40 53 54 55 55 42 42 42 42 ...
output:
59 172
result:
ok 2 lines
Test #25:
score: 10
Accepted
time: 0ms
memory: 22252kb
input:
2 5 300 300 39 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 132 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14...
output:
15 2
result:
ok 2 lines
Test #26:
score: 10
Accepted
time: 3ms
memory: 22224kb
input:
2 5 300 300 82 300 299 300 299 299 299 300 299 300 299 300 299 299 299 300 299 299 300 299 299 300 300 300 300 300 299 300 299 300 299 299 300 299 299 300 300 300 299 300 299 300 300 300 300 299 300 299 300 299 300 300 299 299 300 300 299 300 300 300 299 299 300 299 300 299 300 299 300 300 300 299 2...
output:
300 299
result:
ok 2 lines
Subtask #6:
score: 10
Accepted
Dependency #5:
100%
Accepted
Test #27:
score: 10
Accepted
time: 0ms
memory: 22188kb
input:
40 6 100 100 55 21 89 57 40 63 86 81 67 27 21 93 86 92 67 55 18 98 31 76 24 54 92 84 57 40 19 65 57 8 54 3 11 77 72 43 23 41 77 28 49 95 77 92 11 53 34 7 47 48 96 14 35 46 92 14 28 14 11 79 29 15 45 84 22 39 24 83 58 36 16 69 45 25 60 95 79 72 85 69 50 28 43 10 80 70 73 69 22 20 87 30 25 45 4 81 0 2...
output:
55 68 55 60 51 77 62 88 66 59 67 58 55 55 54 75 71 69 68 88 55 55 56 56 53 60 57 57 54 58 61 53 71 70 56 51 86 69 56 52
result:
ok 40 lines
Test #28:
score: 10
Accepted
time: 3ms
memory: 22288kb
input:
2 6 2000 2000 62 2 2 4 4 5 7 7 8 8 9 11 11 13 13 13 14 14 18 19 19 20 21 22 24 25 25 27 27 27 28 29 30 30 31 32 33 34 34 37 37 40 40 42 44 45 46 47 48 49 52 58 59 60 61 61 62 62 64 65 65 65 65 65 66 66 67 67 69 70 71 72 72 73 74 74 75 75 78 80 80 81 81 83 84 84 84 88 89 90 90 91 94 94 96 96 98 98 98...
output:
1837 1609
result:
ok 2 lines
Test #29:
score: 10
Accepted
time: 3ms
memory: 24356kb
input:
2 6 2000 2000 471 2000 1997 1997 1996 1996 1992 1992 1992 1990 1989 1988 1988 1987 1985 1984 1981 1979 1978 1977 1977 1977 1976 1976 1973 1973 1972 1972 1971 1970 1968 1968 1967 1966 1963 1962 1961 1958 1957 1956 1955 1954 1953 1953 1952 1951 1951 1949 1949 1946 1945 1944 1944 1944 1942 1941 1939 19...
output:
1390 1559
result:
ok 2 lines
Test #30:
score: 10
Accepted
time: 0ms
memory: 22224kb
input:
2 6 2000 2000 169 955 1805 1130 1301 1132 1131 1131 962 962 962 1301 1132 1302 1132 1131 961 1130 1468 959 1297 957 1296 1126 956 1126 1127 1128 959 1299 1130 1129 1469 1132 1302 1302 963 963 963 1132 1131 1130 1636 1296 958 958 958 1128 959 1297 1297 1129 1129 1298 959 1129 1130 1299 959 959 959 95...
output:
1312 890
result:
ok 2 lines
Test #31:
score: 10
Accepted
time: 0ms
memory: 20216kb
input:
2 6 2000 2000 153 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...
output:
12 1488
result:
ok 2 lines
Test #32:
score: 10
Accepted
time: 0ms
memory: 22228kb
input:
2 6 2000 2000 1865 1999 1999 1999 1999 1999 1999 2000 1999 2000 1999 2000 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 1999 2000 1999 2000 2000 2000 1999 2000 1999 1999 1999 1999 1999 1999 2000 2000 2000 1999 2000 1999 2000 1999 2000 1999 2000 1999 2000 2000 2000 2000 1999 2000 1999 1999 2000 2...
output:
1999 1999
result:
ok 2 lines
Subtask #7:
score: 20
Accepted
Test #33:
score: 20
Accepted
time: 15ms
memory: 22460kb
input:
5000 7 19 19 16 4 12 5 15 12 11 9 0 3 1 8 4 17 2 19 3 5 4 1 18 20 19 18 14 12 16 7 14 2 3 13 4 4 6 8 1 16 19 10 20 20 19 3 15 7 5 16 19 0 1 19 10 19 13 17 18 5 1 13 9 4 8 15 19 20 6 8 3 0 12 4 13 19 2 6 4 11 8 17 6 8 13 11 8 20 18 19 19 3 15 19 12 17 11 11 2 4 4 16 13 10 12 15 14 3 10 19 20 20 12 15...
output:
9 10 16 11 11 12 13 12 14 12 10 19 10 9 12 18 10 15 11 9 9 11 9 11 9 11 10 9 18 12 16 11 10 18 9 10 9 14 12 17 9 13 15 11 10 13 11 11 13 11 13 10 9 9 14 10 10 11 12 10 14 12 11 13 10 12 9 13 18 13 11 16 13 15 10 10 13 10 11 12 9 11 11 11 11 18 12 10 10 11 19 11 9 16 11 10 10 10 17 9 16 10 12 10 12 1...
result:
ok 5000 lines
Test #34:
score: 20
Accepted
time: 16ms
memory: 22528kb
input:
5000 7 20 20 17 8 13 3 20 11 14 0 16 9 4 6 12 10 19 17 18 6 12 10 4 20 20 13 20 20 0 8 18 19 0 6 12 12 11 12 6 9 20 13 16 20 16 18 20 20 15 6 16 1 6 2 9 15 4 14 1 14 18 14 13 1 4 19 16 5 16 20 20 14 6 16 0 9 18 16 11 16 2 9 2 9 0 15 10 5 14 18 19 12 20 20 16 11 16 20 15 20 4 18 12 20 1 20 11 13 15 1...
output:
12 12 11 11 14 10 14 13 12 11 15 11 11 12 11 11 10 13 10 12 13 13 12 12 8 14 14 11 14 11 12 18 14 10 12 12 11 12 12 11 13 11 10 12 13 10 14 9 10 10 12 17 10 13 12 15 11 11 12 10 11 11 11 10 10 17 12 13 10 14 14 8 10 12 16 12 16 9 11 14 10 11 12 14 13 11 12 10 11 18 10 12 12 9 10 9 11 15 10 11 9 14 1...
result:
ok 5000 lines
Test #35:
score: 20
Accepted
time: 34ms
memory: 23548kb
input:
2 7 50000 50000 13 14372 18626 2882 156 873 21151 14082 1047 948 5262 23982 17851 3525 45524 36586 13870 5948 12786 22417 48991 16686 3022 26756 27407 35381 1439 1732 31854 48953 2459 28941 6550 19617 8044 43294 42701 20930 33877 11580 1246 1164 30125 6870 9257 20119 28306 13881 7577 5889 4194 5365 ...
output:
49950 49953
result:
ok 2 lines
Test #36:
score: 20
Accepted
time: 26ms
memory: 25660kb
input:
2 7 50000 50000 4 1 2 2 4 5 5 5 10 11 12 12 14 16 18 18 20 20 21 22 22 22 22 23 24 24 26 26 26 27 27 27 28 29 29 31 32 32 33 33 33 34 35 37 39 42 45 46 47 48 50 50 51 52 55 55 56 57 60 63 67 68 69 69 69 69 71 71 73 77 77 78 84 85 86 86 86 87 88 89 89 90 91 91 92 92 93 94 95 96 96 97 97 98 99 100 100...
output:
49964 49950
result:
ok 2 lines
Test #37:
score: 20
Accepted
time: 32ms
memory: 27216kb
input:
2 7 50000 50000 7 50000 49993 49993 49993 49992 49991 49991 49991 49990 49990 49988 49987 49987 49986 49985 49984 49983 49981 49980 49980 49979 49978 49978 49977 49977 49974 49973 49972 49971 49970 49969 49967 49966 49966 49966 49964 49963 49963 49962 49962 49960 49960 49960 49958 49957 49957 49957 ...
output:
49943 49862
result:
ok 2 lines
Test #38:
score: 20
Accepted
time: 9ms
memory: 22872kb
input:
5 7 20000 20000 8 6344 6335 6335 6352 6344 6336 6344 6335 6335 6335 6343 6334 6334 6334 6334 6334 6334 6352 6353 6345 6337 6337 6337 6337 6337 6345 6353 6353 6336 6336 6344 6335 6344 6336 6336 6336 6345 6337 6355 6339 6339 6339 6357 6357 6339 6339 6339 6339 6339 6339 6348 6340 6349 6357 6339 6339 63...
output:
6422 5411 650 7030 2477
result:
ok 5 lines
Test #39:
score: 20
Accepted
time: 10ms
memory: 23032kb
input:
5 7 20000 20000 2 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 1251 12...
output:
9888 2710 14936 603 7797
result:
ok 5 lines
Test #40:
score: 20
Accepted
time: 36ms
memory: 27192kb
input:
2 7 50000 50000 8 50000 49999 49999 50000 50000 49999 50000 49999 50000 50000 49999 49999 49999 50000 50000 49999 50000 49999 49999 49999 50000 49999 49999 49999 50000 49999 49999 50000 50000 49999 49999 49999 49999 49999 49999 49999 49999 50000 50000 50000 50000 50000 50000 50000 50000 50000 49999 ...
output:
50000 50000
result:
ok 2 lines
Subtask #8:
score: 15
Accepted
Dependency #6:
100%
Accepted
Dependency #7:
100%
Accepted
Test #41:
score: 15
Accepted
time: 47ms
memory: 23412kb
input:
2 8 50000 50000 6673 19554 35986 42705 21899 31473 7560 39294 35870 541 16472 47245 23432 15909 47691 24301 46822 20982 2334 36820 13274 44584 26614 17600 27283 16933 25520 10643 30510 12571 332 11818 20945 12015 34688 39814 12779 38464 4671 33555 44413 3733 13075 16886 29885 435 9753 37882 40230 26...
output:
38283 38191
result:
ok 2 lines
Test #42:
score: 15
Accepted
time: 29ms
memory: 23508kb
input:
2 8 50000 50000 5694 0 0 1 3 5 7 9 9 9 12 15 15 17 20 21 21 23 24 28 30 33 35 38 39 39 40 41 42 43 44 45 46 47 47 49 49 49 49 51 52 52 53 54 55 56 56 56 57 59 62 62 64 65 65 66 66 67 68 69 69 70 70 72 73 76 78 79 80 81 81 82 82 82 83 87 88 88 91 91 91 92 92 94 94 95 95 97 98 98 98 100 102 102 103 10...
output:
39836 41092
result:
ok 2 lines
Test #43:
score: 15
Accepted
time: 28ms
memory: 21540kb
input:
2 8 50000 50000 8333 50000 49997 49996 49995 49995 49993 49992 49991 49991 49988 49982 49981 49981 49980 49979 49978 49978 49976 49976 49975 49971 49971 49970 49967 49967 49966 49964 49963 49963 49963 49962 49960 49960 49960 49959 49959 49957 49956 49956 49956 49956 49955 49955 49953 49952 49950 499...
output:
36762 39631
result:
ok 2 lines
Test #44:
score: 15
Accepted
time: 20ms
memory: 20852kb
input:
5 8 20000 20000 68 2416 2416 2416 2416 2484 2415 2483 2414 2414 2414 2483 2415 2484 2416 2485 2417 2485 2416 2485 2555 2419 2419 2487 2418 2418 2418 2418 2418 2418 2418 2418 2418 2486 2417 2417 2485 2484 2415 2415 2484 2553 2416 2416 2416 2484 2415 2415 2415 2415 2483 2414 2414 2414 2550 2412 2412 2...
output:
2594 8074 9162 8784 1723
result:
ok 5 lines
Test #45:
score: 15
Accepted
time: 12ms
memory: 22832kb
input:
5 8 20000 20000 1821 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 12473 124...
output:
12444 5 16336 26 3404
result:
ok 5 lines
Test #46:
score: 15
Accepted
time: 27ms
memory: 27376kb
input:
2 8 50000 50000 816 49999 50000 50000 49999 50000 49999 49999 49999 50000 49999 50000 49999 49999 49999 50000 50000 50000 50000 49999 50000 49999 49999 49999 50000 49999 49999 49999 50000 50000 49999 49999 49999 50000 50000 49999 49999 49999 49999 49999 49999 49999 50000 50000 50000 50000 49999 4999...
output:
50000 50000
result:
ok 2 lines
Subtask #9:
score: 10
Accepted
Dependency #1:
100%
Accepted
Dependency #7:
100%
Accepted
Test #47:
score: 10
Accepted
time: 149ms
memory: 25224kb
input:
100000 9 10 10 9 10 2 2 8 6 10 4 10 9 7 10 10 6 5 5 9 3 6 1 6 5 9 2 10 10 1 10 3 2 2 7 10 2 5 3 7 10 10 6 0 10 1 3 7 4 4 9 7 5 10 10 5 3 3 4 3 2 9 0 2 10 10 10 10 5 8 7 1 10 5 1 2 4 9 8 10 10 5 9 9 4 8 2 6 6 7 8 3 10 10 7 1 0 2 1 10 7 9 6 0 4 10 10 2 1 3 7 1 6 6 9 4 10 2 10 10 4 2 4 0 3 7 5 0 0 0 1 ...
output:
6 6 8 5 5 5 6 5 7 3 4 7 4 3 5 6 6 5 6 7 6 5 5 7 5 6 6 5 5 5 6 6 5 7 5 5 3 6 4 7 4 6 7 6 6 4 6 6 5 4 7 8 7 4 6 3 5 6 5 7 6 6 5 7 4 5 6 6 4 8 6 6 7 6 6 4 9 6 8 5 7 7 5 4 5 5 6 5 7 6 5 6 5 8 5 8 5 9 4 5 8 5 6 8 6 4 4 6 5 6 8 6 5 7 8 6 6 5 7 6 6 6 5 5 9 6 9 7 6 6 6 6 6 5 3 9 9 7 6 5 7 5 6 4 5 5 5 6 8 5 ...
result:
ok 100000 lines
Test #48:
score: 10
Accepted
time: 607ms
memory: 40184kb
input:
2 9 500000 500000 18 41261 430172 195520 156650 355283 458369 480245 42876 191405 33350 238393 62275 347902 223912 202392 269274 134544 147085 38323 295100 365049 138397 324229 310866 141549 468237 84007 334290 454951 451932 22576 481019 60870 337809 489626 30633 155666 405866 258805 250747 174503 2...
output:
499939 499953
result:
ok 2 lines
Test #49:
score: 10
Accepted
time: 407ms
memory: 40176kb
input:
2 9 500000 500000 4 0 0 3 3 3 3 3 6 6 7 7 7 8 9 9 11 11 12 15 16 16 17 20 22 22 23 24 25 25 25 27 28 29 30 31 31 32 33 33 37 38 40 42 43 46 47 47 47 48 52 52 54 55 56 56 56 58 58 59 62 65 65 65 66 67 67 69 69 70 70 71 72 74 75 76 76 79 80 81 81 85 86 87 87 92 92 93 93 96 96 97 97 97 98 99 99 100 102...
output:
499961 499979
result:
ok 2 lines
Test #50:
score: 10
Accepted
time: 610ms
memory: 40132kb
input:
2 9 500000 500000 12 500000 499999 499999 499999 499999 499998 499996 499994 499994 499992 499990 499990 499988 499987 499986 499986 499986 499985 499985 499984 499982 499982 499980 499979 499978 499978 499978 499978 499976 499976 499975 499974 499974 499970 499969 499969 499969 499966 499966 499964...
output:
499884 499846
result:
ok 2 lines
Test #51:
score: 10
Accepted
time: 168ms
memory: 33760kb
input:
2 9 500000 500000 1 57526 57526 57526 57526 57526 57526 57526 57526 57526 57528 57527 57528 57526 57527 57527 57523 57523 57525 57524 57525 57523 57525 57524 57524 57524 57524 57526 57525 57525 57525 57525 57525 57529 57527 57527 57528 57526 57526 57526 57526 57526 57526 57526 57526 57526 57526 5752...
output:
57600 188621
result:
ok 2 lines
Test #52:
score: 10
Accepted
time: 119ms
memory: 26656kb
input:
100 9 10000 10000 4 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 3396 ...
output:
3905 1037 2139 4577 6625 247 7709 7998 492 8263 7321 74 4243 9010 9218 6278 1033 733 7122 170 3857 5016 2792 4599 1460 1110 10000 427 6594 256 866 8044 3303 125 5637 663 7019 1105 846 6163 1767 383 267 1558 1508 8423 7132 1319 625 641 3012 3588 2410 3577 56 4853 1723 1184 3638 1112 6176 5337 855 221...
result:
ok 100 lines
Test #53:
score: 10
Accepted
time: 247ms
memory: 39240kb
input:
2 9 500000 500000 11 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 32002 320...
output:
35537 393027
result:
ok 2 lines
Test #54:
score: 10
Accepted
time: 595ms
memory: 40412kb
input:
2 9 500000 500000 12 500000 499999 500000 500000 499999 500000 499999 499999 500000 500000 500000 499999 499999 500000 500000 500000 499999 500000 500000 500000 499999 500000 500000 500000 499999 500000 500000 499999 500000 500000 500000 500000 499999 500000 499999 499999 500000 500000 499999 499999...
output:
500000 500000
result:
ok 2 lines
Subtask #10:
score: 15
Accepted
Dependency #2:
100%
Accepted
Dependency #8:
100%
Accepted
Dependency #9:
100%
Accepted
Test #55:
score: 15
Accepted
time: 510ms
memory: 33416kb
input:
5 10 200000 200000 34996 149807 114538 102466 91885 93913 56295 190852 159208 91575 181035 172405 12906 20377 198780 78309 56111 95848 72590 20870 8269 144477 8400 3121 92664 131089 39718 97994 157342 57689 31609 23976 138755 139592 17657 18418 159274 194790 117461 156383 168496 154809 175283 35979 ...
output:
145822 113022 121383 113011 121895
result:
ok 5 lines
Test #56:
score: 15
Accepted
time: 399ms
memory: 40144kb
input:
2 10 500000 500000 4565 0 0 0 2 4 6 7 8 9 9 11 11 12 13 13 14 14 14 15 15 17 17 18 18 18 18 21 23 24 24 25 25 26 26 26 29 30 31 32 32 37 38 38 41 44 47 49 49 50 50 52 53 54 55 56 56 56 58 59 61 62 62 65 66 66 67 68 68 70 70 72 72 74 75 75 76 78 78 78 79 80 81 82 83 83 83 84 84 86 86 87 87 87 87 88 8...
output:
481134 390120
result:
ok 2 lines
Test #57:
score: 15
Accepted
time: 350ms
memory: 39900kb
input:
2 10 500000 500000 80206 500000 499999 499999 499998 499997 499996 499996 499995 499995 499994 499993 499992 499991 499991 499991 499990 499988 499983 499983 499980 499979 499979 499978 499973 499973 499972 499972 499971 499971 499968 499967 499965 499965 499964 499962 499962 499962 499962 499961 49...
output:
370216 431552
result:
ok 2 lines
Test #58:
score: 15
Accepted
time: 130ms
memory: 31992kb
input:
2 10 500000 500000 6268 5996 5996 5996 5996 5996 5996 5996 12265 5997 5997 5997 5997 5997 5997 5997 5997 5997 5997 5997 5997 5997 12265 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996 5996...
output:
11931 98285
result:
ok 2 lines
Test #59:
score: 15
Accepted
time: 89ms
memory: 25628kb
input:
100 10 10000 10000 6211 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2173 2...
output:
3970 970 2272 988 7077 2 64 4183 2 4739 7058 6554 5678 5679 5907 2 7815 5533 4 17 4887 6905 1 2183 3 1 4 2 5692 1 20 2587 2927 2 4510 3214 1965 3 12 5009 2 2 2 2349 7 2 2 3998 3474 2070 5163 3 27 3947 2307 2191 1 7 1 1 3674 12 532 1 1 2 1 1243 1 2351 4373 33 742 2 3174 2 1 3396 1 155 1 5596 2133 6 4...
result:
ok 100 lines
Test #60:
score: 15
Accepted
time: 272ms
memory: 39696kb
input:
2 10 500000 500000 9705 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361001 361...
output:
361001 162724
result:
ok 2 lines
Test #61:
score: 15
Accepted
time: 378ms
memory: 40476kb
input:
2 10 500000 500000 430421 499999 499999 499999 499999 499999 499999 499999 500000 499999 500000 500000 500000 500000 500000 500000 500000 499999 500000 500000 499999 499999 499999 499999 499999 499999 499999 500000 500000 500000 500000 499999 500000 500000 499999 499999 500000 499999 499999 499999 4...
output:
499999 499999
result:
ok 2 lines