QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#106747 | #5517. Adjacent Product Sum | maspy | AC ✓ | 25ms | 7036kb | C++23 | 13.8kb | 2023-05-19 02:38:57 | 2023-05-19 02:39:00 |
Judging History
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
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); }
// (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, typename U>
T ceil(T x, U y) {
return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sum = 0;
for (auto &&a: A) sum += a;
return sum;
}
#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) {
assert(!que.empty());
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
assert(!que.empty());
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng) {
assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>
namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
template <class T>
static auto check(T &&x) -> decltype(x.write(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};
struct has_read_impl {
template <class T>
static auto check(T &&x) -> decltype(x.read(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};
struct Scanner {
FILE *fp;
char line[(1 << 15) + 1];
size_t st = 0, ed = 0;
void reread() {
memmove(line, line + st, ed - st);
ed -= st;
st = 0;
ed += fread(line + ed, 1, (1 << 15) - ed, fp);
line[ed] = '\0';
}
bool succ() {
while (true) {
if (st == ed) {
reread();
if (st == ed) return false;
}
while (st != ed && isspace(line[st])) st++;
if (st != ed) break;
}
if (ed - st <= 50) {
bool sep = false;
for (size_t i = st; i < ed; i++) {
if (isspace(line[i])) {
sep = true;
break;
}
}
if (!sep) reread();
}
return true;
}
template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
while (true) {
size_t sz = 0;
while (st + sz < ed && !isspace(line[st + sz])) sz++;
ref.append(line + st, sz);
st += sz;
if (!sz || st != ed) break;
reread();
}
return true;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
bool neg = false;
if (line[st] == '-') {
neg = true;
st++;
}
ref = T(0);
while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
if (neg) ref = -ref;
return true;
}
template <typename T,
typename enable_if<has_read<T>::value>::type * = nullptr>
inline bool read_single(T &x) {
x.read();
return true;
}
bool read_single(double &ref) {
string s;
if (!read_single(s)) return false;
ref = std::stod(s);
return true;
}
bool read_single(char &ref) {
string s;
if (!read_single(s) || s.size() != 1) return false;
ref = s[0];
return true;
}
template <class T>
bool read_single(vector<T> &ref) {
for (auto &d: ref) {
if (!read_single(d)) return false;
}
return true;
}
template <class T, class U>
bool read_single(pair<T, U> &p) {
return (read_single(p.first) && read_single(p.second));
}
template <size_t N = 0, typename T>
void read_single_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
read_single(x);
read_single_tuple<N + 1>(t);
}
}
template <class... T>
bool read_single(tuple<T...> &tpl) {
read_single_tuple(tpl);
return true;
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
bool f = read_single(h);
assert(f);
read(t...);
}
Scanner(FILE *fp) : fp(fp) {}
};
struct Printer {
Printer(FILE *_fp) : fp(_fp) {}
~Printer() { flush(); }
static constexpr size_t SIZE = 1 << 15;
FILE *fp;
char line[SIZE], small[50];
size_t pos = 0;
void flush() {
fwrite(line, 1, pos, fp);
pos = 0;
}
void write(const char val) {
if (pos == SIZE) flush();
line[pos++] = val;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
void write(T val) {
if (pos > (1 << 15) - 50) flush();
if (val == 0) {
write('0');
return;
}
if (val < 0) {
write('-');
val = -val; // todo min
}
size_t len = 0;
while (val) {
small[len++] = char(0x30 | (val % 10));
val /= 10;
}
for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
pos += len;
}
void write(const string s) {
for (char c: s) write(c);
}
void write(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) write(s[i]);
}
void write(const double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
void write(const long double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
template <typename T,
typename enable_if<has_write<T>::value>::type * = nullptr>
inline void write(T x) {
x.write();
}
template <class T>
void write(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
template <class T, class U>
void write(const pair<T, U> val) {
write(val.first);
write(' ');
write(val.second);
}
template <size_t N = 0, typename T>
void write_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { write(' '); }
const auto x = std::get<N>(t);
write(x);
write_tuple<N + 1>(t);
}
}
template <class... T>
bool write(tuple<T...> tpl) {
write_tuple(tpl);
return true;
}
template <class T, size_t S>
void write(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
void write(i128 val) {
string s;
bool negative = 0;
if (val < 0) {
negative = 1;
val = -val;
}
while (val) {
s += '0' + int(val % 10);
val /= 10;
}
if (negative) s += "-";
reverse(all(s));
if (len(s) == 0) s = "0";
write(s);
}
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
printer.write(head);
if (sizeof...(Tail)) printer.write(' ');
print(forward<Tail>(tail)...);
}
void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
scanner.read(head);
read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __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"
void solve() {
LL(N);
VEC(ll, A, N);
sort(all(A));
vc<int> I;
FOR(i, N) if (i % 2 == 0) I.eb(i);
FOR_R(i, N) if (i % 2 == 1) I.eb(i);
A = rearrange(A, I);
ll ANS = 0;
FOR(i, N) {
int j = (i + 1 == N ? 0 : i + 1);
ANS += A[i] * A[j];
}
print(ANS);
}
signed main() {
INT(T);
FOR(T) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3420kb
input:
4 3 1 2 3 6 1 1 1 1 0 0 5 100000 100000 100000 100000 -100000 5 1 2 3 4 5
output:
11 3 10000000000 48
result:
ok 4 number(s): "11 3 10000000000 48"
Test #2:
score: 0
Accepted
time: 24ms
memory: 6952kb
input:
1 200000 11009 633591 -419208 -664908 731171 -774644 -878270 656078 -38057 -220602 -897906 670165 -765931 -612936 -583782 -549624 -644245 137209 -983054 -110583 349193 699723 -412876 -417691 810865 -474314 -200632 570810 -283481 39600 20940 218215 -408751 -507326 -961614 600863 499517 -538207 767155...
output:
66608463123493911
result:
ok 1 number(s): "66608463123493911"
Test #3:
score: 0
Accepted
time: 19ms
memory: 6944kb
input:
1 200000 7902 376928 977876 -664787 382287 -671247 263725 -875047 554163 59899 -976624 726497 617682 -387432 -960499 -703748 -644991 72374 -564962 -569121 -412123 907945 -379338 915496 665461 389485 -742294 942448 -862668 -677446 -72510 -382856 893536 128827 -596269 -572440 -532339 536145 -521524 -3...
output:
66581505433554478
result:
ok 1 number(s): "66581505433554478"
Test #4:
score: 0
Accepted
time: 13ms
memory: 6896kb
input:
1 200000 969944 -942957 346587 328855 61775 -596222 -622652 -504245 181233 -694452 -90194 -350098 1294 844554 -273993 205351 -674109 35911 887981 -929585 826563 179388 689051 -716467 450354 -746718 -220733 348937 529775 -331268 868892 -885852 -839030 834684 803928 225887 435807 575645 189798 -255705...
output:
66721135858270454
result:
ok 1 number(s): "66721135858270454"
Test #5:
score: 0
Accepted
time: 25ms
memory: 7036kb
input:
1 200000 -68015 -262842 778522 -607801 -287109 542027 -515508 -105072 871526 -483654 865940 -391840 419758 -929943 -650710 -885551 359996 -965702 340923 611878 -899901 387610 -214190 616720 235247 117080 300828 -342648 20292 -83165 747072 -521774 561331 505688 -830728 -877713 438804 -419707 -35659 7...
output:
66646767806203928
result:
ok 1 number(s): "66646767806203928"
Test #6:
score: 0
Accepted
time: 15ms
memory: 6996kb
input:
1 200000 894027 417274 -887618 -579309 -635992 645424 598116 363804 -536255 -203152 787222 531567 866594 -732810 35796 -941601 -703973 -65388 759014 -811810 -724439 595832 -180652 -78465 -945009 113803 -212463 994139 377883 -800211 -311527 -59622 828766 -788457 -493755 885764 372098 -380207 675663 8...
output:
66669581129323609
result:
ok 1 number(s): "66669581129323609"
Test #7:
score: 0
Accepted
time: 12ms
memory: 5428kb
input:
2 100000 169603 145427 -202283 -480350 -856872 -65853 -442884 -773569 -275747 -953075 873381 -155156 -519569 -351127 558958 -345448 461553 927180 -310163 -46521 -857521 -906097 -91734 875600 836439 39554 488295 162237 -570813 -456645 -876308 254421 93745 689934 -712525 31372 536079 487786 191237 747...
output:
33392172147649469 33329865049707147
result:
ok 2 number(s): "33392172147649469 33329865049707147"
Test #8:
score: 0
Accepted
time: 20ms
memory: 5432kb
input:
2 100000 166496 -139607 131578 -451857 794246 -927605 601038 660456 316473 -672574 -170486 -196898 -101105 909229 -754537 535280 -602416 -74433 -857221 -435356 381164 365348 -58196 208786 621332 -998574 -990145 -431275 -213222 -110468 65094 716574 430883 -604211 -375551 829699 -495776 -535937 -13229...
output:
33445326050536015 33363059196148572
result:
ok 2 number(s): "33445326050536015 33363059196148572"
Test #9:
score: 0
Accepted
time: 20ms
memory: 5500kb
input:
2 100000 -871463 568880 -401636 611487 445363 -852579 777884 -870669 -56457 -461776 -249205 824583 -717493 71511 868747 -555622 -603163 825881 595722 -893894 -380151 573570 -24659 548454 377854 -134776 496566 -157711 242444 -827514 -56727 -919349 698318 -933207 954943 -343604 472370 -496437 579028 -...
output:
33375458994693108 33453260311973619
result:
ok 2 number(s): "33375458994693108 33453260311973619"
Test #10:
score: 0
Accepted
time: 19ms
memory: 5336kb
input:
2 100000 90579 -751006 -67776 -423243 124850 -749182 856656 -471496 -429386 783875 637226 782840 666120 -668134 -444748 353477 430943 -175732 -986188 745643 -204689 781792 -927900 -118360 162747 -236127 -981874 213927 669738 -579410 884675 577656 604 737799 355139 -510426 -587857 -456937 325201 -996...
output:
33287772768665659 33313392958107202
result:
ok 2 number(s): "33287772768665659 33313392958107202"
Test #11:
score: 0
Accepted
time: 23ms
memory: 5392kb
input:
2 100000 -947380 -70891 -670693 -394750 -224033 389067 -1349 -2620 -773945 -935625 656582 -293754 -915416 494148 -821465 -737425 -633027 -212195 466755 287104 68848 53235 -894362 249678 982492 -309107 -460313 557194 -972672 -331307 860928 -23415 -668739 408803 692113 316272 380289 -417437 -963479 -9...
output:
33288924160392129 33379620728513712
result:
ok 2 number(s): "33288924160392129 33379620728513712"
Test #12:
score: 0
Accepted
time: 13ms
memory: 3624kb
input:
10 20000 841746 527518 595261 331297 -946901 129987 670374 -140388 -684770 309555 -302589 415564 -387435 613331 -624940 -95922 945847 -199224 24636 -565799 -72069 -395358 -523453 -511446 854898 -846967 -749453 -341866 173256 -508156 574073 878761 984359 798117 -622388 434663 264157 607113 -38776 139...
output:
6622802477773024 6640013265208007 6592100254591181 6640170208895030 6688143425864831 6705222845668074 6676830146528095 6618221005278570 6714940493280121 6724345935461679
result:
ok 10 numbers
Test #13:
score: 0
Accepted
time: 18ms
memory: 3532kb
input:
100 2000 -607224 -718287 -433045 -816611 -935719 -559217 508630 -485197 134273 -520442 886499 318527 104344 -376092 -146638 -921227 98459 -324526 -396653 39142 -536124 114612 -22769 215450 -806035 217692 -758435 -360933 -470886 -271877 -839014 683804 138195 405799 -385833 481109 198084 -145350 -4353...
output:
664320265599433 656060796084111 670847172001984 693285015575982 641806321082038 686775083044219 660836368097072 665848189708176 656774554796514 640515026177509 637922445211883 651793096312130 668305333192730 680836044550146 642790615977139 659533778528338 689986245290621 679990801733695 664398460938...
result:
ok 100 numbers
Test #14:
score: 0
Accepted
time: 7ms
memory: 3392kb
input:
1000 200 324840 875913 -750586 872247 891834 -802538 -394930 -39271 -402853 -935536 -148671 -311516 -470147 168411 428251 -412526 736882 93448 384219 -987587 -924419 974032 864821 448111 409149 -889736 17366 -198877 -314710 -952652 406856 124043 183144 -182906 -79075 308212 785198 -276953 260766 178...
output:
65021379321819 61482831940623 64907628507685 65762816459484 64637099110104 70521910685375 71017401353273 63188959323659 64923749759877 78536500128365 72214363259863 72551077515316 64319147242944 70483971638209 60920280492111 74602439250852 66241024614625 66265066071760 69062565668032 71163034443457 ...
result:
ok 1000 numbers
Test #15:
score: 0
Accepted
time: 9ms
memory: 3444kb
input:
10000 20 15812 -152393 101507 981503 -762519 70570 197040 710069 767152 -683226 691070 -756515 -396347 -388139 -327351 -323136 -451642 -327842 989160 548358 20 -344746 439864 -408284 787179 -526193 -898718 -1701 -843020 956421 697486 -822953 243028 -209174 82020 -997778 242139 -932413 -673559 176880...
output:
5836057833484 7900249490263 6741513108893 7695904868186 5905346687260 6210447934702 6528577603481 6366200793553 7285941052913 6695898759021 5336229787408 6603459571509 5516442382707 6068193077387 6836405277420 5809766642183 7914983783571 7722262525971 6863867878728 5452027662683 6336759366520 571716...
result:
ok 10000 numbers
Test #16:
score: 0
Accepted
time: 19ms
memory: 3560kb
input:
42 4761 -884836 423256 -16540 5180 626061 574189 64375 565165 891155 631808 84833 -143882 -909496 758173 204660 -700050 163672 -867390 920820 848717 -347766 -768001 437344 -21942 403333 -220324 388822 84096 -938705 527686 841315 876833 131270 836458 700753 -740379 253394 -432058 494815 -255931 -8361...
output:
1568197940334474 1627465779774764 1613876915865833 1579828038154862 1563836977436851 1608582638636216 1589836095120383 1577031292775532 1608544317984962 1617042083628598 1589929522676958 1588048186120208 1562897607148914 1551101839004540 1582371865754027 1590036248776725 1606863383861959 16117573084...
result:
ok 42 numbers
Test #17:
score: 0
Accepted
time: 6ms
memory: 3592kb
input:
69 2898 -826877 -729045 -951445 -391404 197462 798213 -288928 -157886 631013 -85218 377079 -128051 -661781 -189943 -900471 43621 -847997 400563 -695730 -932224 -245215 -395642 -559167 -118464 920363 252772 -623730 -286403 -674675 -560306 -448483 924941 210935 -834513 608008 -136257 -953207 665428 29...
output:
942714868546250 946859857816400 969037992012804 977484785384248 919489346073972 969868311124320 933818196842132 977503973543166 967593973040804 982214889485424 963286569050653 970847618560724 957508838495683 945357209274080 933598867828567 978233850926901 975379109413588 1000443792815115 98105291396...
result:
ok 69 numbers