QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#221419#7617. Spectacleucup-team087#AC ✓57ms8868kbC++144.0kb2023-10-21 13:18:002023-10-21 13:18:01

Judging History

你现在查看的是最新测评结果

  • [2023-10-21 13:18:01]
  • 评测
  • 测评结果:AC
  • 用时:57ms
  • 内存:8868kb
  • [2023-10-21 13:18:00]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")


// [0, n), 0 <= n <= 2^(6D)
template <int D> struct Set {
  int n;
  vector<unsigned long long> a[D];
  explicit Set(int n_ = 0) : n(n_) {
    static_assert(1 <= D && D <= 6, "Set: 1 <= D <= 6 must hold");
    assert(0 <= n); assert(n <= 1LL << (6 * D));
    int m = n ? n : 1;
    for (int d = 0; d < D; ++d) {
      m = (m + 63) >> 6;
      a[d].assign(m, 0);
    }
  }
  bool empty() const {
    return !a[D - 1][0];
  }
  bool contains(int x) const {
    return (a[0][x >> 6] >> (x & 63)) & 1;
  }
  void insert(int x) {
    for (int d = 0; d < D; ++d) {
      const int q = x >> 6, r = x & 63;
      a[d][q] |= 1ULL << r;
      x = q;
    }
  }
  void erase(int x) {
    for (int d = 0; d < D; ++d) {
      const int q = x >> 6, r = x & 63;
      if ((a[d][q] &= ~(1ULL << r))) break;
      x = q;
    }
  }
  // min s.t. >= x
  int next(int x) const {
    for (int d = 0; d < D; ++d) {
      const int q = x >> 6, r = x & 63;
      if (static_cast<unsigned>(q) >= a[d].size()) break;
      const unsigned long long upper = a[d][q] >> r;
      if (upper) {
        x += __builtin_ctzll(upper);
        for (int e = d - 1; e >= 0; --e) x = x << 6 | __builtin_ctzll(a[e][x]);
        return x;
      }
      x = q + 1;
    }
    return n;
  }
  // max s.t. <= x
  int prev(int x) const {
    for (int d = 0; d < D; ++d) {
      if (x < 0) break;
      const int q = x >> 6, r = x & 63;
      const unsigned long long lower = a[d][q] << (63 - r);
      if (lower) {
        x -= __builtin_clzll(lower);
        for (int e = d - 1; e >= 0; --e) x = x << 6 | (63 - __builtin_clzll(a[e][x]));
        return x;
      }
      x = q - 1;
    }
    return -1;
  }
};

////////////////////////////////////////////////////////////////////////////////


constexpr Int INF = 1001001001001001001LL;

int N;
vector<Int> A;

int main() {
  for (; ~scanf("%d", &N); ) {
    A.resize(N);
    for (int i = 0; i < N; ++i) {
      scanf("%lld", &A[i]);
    }
    sort(A.begin(), A.end());
    
    vector<pair<Int, int>> ds(N - 1);
    for (int i = 0; i < N - 1; ++i) {
      ds[i] = make_pair(A[i + 1] - A[i], i + 1);
    }
    sort(ds.begin(), ds.end());
    
    vector<Int> ans(N/2 + 1, INF);
    int now = 0;
    Set<4> ss(N + 1);
    for (int i = 0; i <= N; ++i) {
      ss.insert(i);
    }
    for (const auto &di : ds) {
      const int i = di.second;
      ss.erase(i);
      const int l = ss.prev(i);
      const int r = ss.next(i);
      now -= (i - l) / 2;
      now -= (r - i) / 2;
      now += (r - l) / 2;
      chmin(ans[now], di.first);
    }
    
    for (int k = N/2; k >= 1; --k) {
      chmin(ans[k - 1], ans[k]);
    }
    for (int k = 1; k <= N/2; ++k) {
      if (k > 1) printf(" ");
      printf("%lld", ans[k]);
    }
    puts("");
  }
  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3772kb

input:

6
100 13 20 14 10 105

output:

1 5 6

result:

ok single line: '1 5 6'

Test #2:

score: 0
Accepted
time: 0ms
memory: 4120kb

input:

2
1 1000000000000000000

output:

999999999999999999

result:

ok single line: '999999999999999999'

Test #3:

score: 0
Accepted
time: 54ms
memory: 8672kb

input:

200000
30977570544127554 30977570529630987 30977570554040634 30977570903666181 30977570284338326 30977570675313216 30977569987827221 30977570780807305 30977570623822067 30977570207823010 30977569932624714 30977570440962037 30977570343703869 30977570239637322 30977570141845422 30977570372368100 30977...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 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 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...99 9999 10000 10000 10000 10000'

Test #4:

score: 0
Accepted
time: 57ms
memory: 8684kb

input:

199999
74225923558391860 74225923555315010 74225923556516953 74225923551906374 74225923556406290 74225923554845656 74225923553158677 74225923552168021 74225923552488839 74225923558104378 74225923548968334 74225923556196025 74225923554130488 74225923551557287 74225923551636063 74225923553115850 74225...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...100 100 100 100 100 100 100 100'

Test #5:

score: 0
Accepted
time: 53ms
memory: 8632kb

input:

199998
30364705970102215 30364705975614091 30364705966085328 30364705968500710 30364705973927899 30364705974652854 30364705972138795 30364705972269859 30364705968295813 30364705971059367 30364705969588238 30364705968137939 30364705974738716 30364705968753105 30364705966038442 30364705971802485 30364...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...100 100 100 100 100 100 100 100'

Test #6:

score: 0
Accepted
time: 51ms
memory: 8824kb

input:

199480
84592746384504493 85738726390219951 86178266392423453 85270046387888059 86023466391649728 85583726389451524 86002856391547043 84685716384968787 86329686393180247 85236986387723812 85708756390071019 85413466388602081 86233746392701992 84803586385556562 85557236389320528 85791856390487927 84672...

output:

10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 ...

result:

ok single line: '10000000000 10000000000 100000...0000100 10000000100 10000000100'

Test #7:

score: 0
Accepted
time: 51ms
memory: 8660kb

input:

200000
33856469454175218 32241538647103594 33403819228381345 33177149114948151 32787958920796758 33422079237455153 33010409031325703 32684338868967489 33604689328558231 33004559028314693 32454988753853454 33128799090730506 32943158998187553 33328989190849604 32227688640025932 32079908566155339 33811...

output:

10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000000 10000000001 10000000001 10000000001 10000000001 10000000001 10000000001 10000000001 10000000001 ...

result:

ok single line: '10000000000 10000000000 100000...0010000 10000010000 10000010000'

Test #8:

score: 0
Accepted
time: 53ms
memory: 8824kb

input:

200000
99366431928807092 100905378904316435 100911009192786633 99651286201033529 99819514579173803 101106458946586520 100540780686784584 101043055796578181 99592763261743228 100942010747380829 100696638508677938 99557111479951837 99868487063565932 100160401644471199 99713809268610583 100385172883868...

output:

10000000006 10000000016 10000000020 10000000032 10000000035 10000000053 10000000053 10000000058 10000000070 10000000072 10000000075 10000000081 10000000087 10000000093 10000000100 10000000106 10000000108 10000000109 10000000115 10000000124 10000000127 10000000129 10000000135 10000000143 10000000143 ...

result:

ok single line: '10000000006 10000000016 100000...0999957 10000999988 10000999999'

Test #9:

score: 0
Accepted
time: 37ms
memory: 8588kb

input:

200000
32700778250955708 80973219923443275 21857717442999902 43797982114805364 64455294076602223 43167957894214273 62729170034883115 49414859579787686 77819282489260355 19599536983889234 23117932964608724 441989375073013 16248646817304112 24464319832610872 30266523787884500 48811648428791715 4758356...

output:

100001694778 100011537215 100018424878 100029054890 100038489429 100040599373 100060957721 100064532796 100082929373 100094297473 100121900518 100133293850 100138596612 100143308691 100151531871 100157353399 100165405961 100166843907 100167811301 100170440732 100193675572 100203481901 100211841898 1...

result:

ok single line: '100001694778 100011537215 1000...37798 999991792406 999999454382'

Test #10:

score: 0
Accepted
time: 44ms
memory: 8688kb

input:

200000
6569359353628663 97946128078339937 17494029986134100 100924003827921186 11700645561107794 83293172818052901 21223010712958734 841630030313660 96799993829840547 85100836569458133 88151077712158296 72786904255811297 61939995575465801 99192160785313911 39532789500618633 84758775636951967 5045495...

output:

100003370564 100023061163 100028886529 100038463297 100048519031 100058381977 100066115437 100075170206 100081496846 100086662115 100097367297 100108830692 100117774190 100123397321 100123544710 100136957578 100142501065 100153189912 100155584304 100158582928 100185590822 100189940700 100195142966 1...

result:

ok single line: '100003370564 100023061163 1000...32247 999993633434 999998540345'

Test #11:

score: 0
Accepted
time: 52ms
memory: 8668kb

input:

200000
110237749899912574 44029219488421966 66077159969487729 33418726829355640 121938285791249490 41936498998440708 89872521728758195 82407894859522462 20242415664315585 79289535587247584 16836339605600978 22042147517717339 59418755984357365 83373894043638856 16548271192908193 115903283708859781 11...

output:

100001826602 100005905536 100033597771 100047567516 100081774803 100085066073 100094733586 100096341140 100102148244 100119765146 100129720810 100138002015 100148924035 100155549370 100177640105 100180216095 100186042809 100198014927 100199386271 100205721828 100209590896 100218921781 100234465766 1...

result:

ok single line: '100001826602 100005905536 1000...94209 999993765161 999998721815'

Test #12:

score: 0
Accepted
time: 55ms
memory: 8736kb

input:

199999
121092073445798052 82616954481238077 120510005157506274 71336656841049803 95035428228038535 164893648159232321 142319775584441102 93342188853318621 168411656989067807 148994980394763978 104237269192839505 99774814505522549 148415946553483074 65191024044971467 67700681674222439 172670562177273...

output:

100005754509 100020622674 100033500546 100035483620 100043447570 100046139058 100060829922 100064382990 100066030408 100087475615 100097271715 100104394783 100109744443 100129525380 100136326991 100154146754 100159040597 100170193971 100192869633 100201725825 100218310870 100232160624 100236258463 1...

result:

ok single line: '100005754509 100020622674 1000...40424 999976560280 999982248447'

Test #13:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

10
56 6 7 96 88 49 1 32 33 58

output:

1 1 2 8 25

result:

ok single line: '1 1 2 8 25'

Test #14:

score: 0
Accepted
time: 50ms
memory: 8588kb

input:

199998
52959547547202889 27883087119454473 68184600667101408 30904934731974071 51276657510526688 79205779022222465 78042783625872294 87899276576481839 28085622837375739 69657987967916697 34492458701495907 74726204649732239 108762334018233187 72687751539916620 80211662132497764 92375130299620804 1343...

output:

100003988303 100008261500 100009610817 100015164868 100017398062 100042444579 100054747949 100066703556 100074759567 100086480424 100091153960 100114030162 100115725415 100129416809 100133612940 100147453186 100155876029 100159200262 100164599286 100173010101 100178686190 100193971504 100197223290 1...

result:

ok single line: '100003988303 100008261500 1000...19620 999996888939 999997612993'

Test #15:

score: 0
Accepted
time: 56ms
memory: 8800kb

input:

200000
107278980243561240 46200864635282020 36068769980390029 85860896775727323 85854085124933722 41605190073320874 36029377900762694 69123669914279026 113081963361197413 126601065689655124 87704687011447154 78289062558171704 73511519627704787 52190123639770458 55338428152425818 110094367821735645 3...

output:

100005596903 100010720561 100024308487 100024412358 100025262782 100030843098 100035100359 100035306446 100042493698 100046503245 100050757687 100062095132 100078794374 100080825085 100081065885 100083372364 100118012907 100122021904 100123073320 100123249935 100137168936 100137176372 100140070622 1...

result:

ok single line: '100005596903 100010720561 1000...75277 999966252260 999989143803'

Test #16:

score: 0
Accepted
time: 37ms
memory: 6884kb

input:

131071
355065566094904377 352186493689629362 286605647438505804 565192073890459632 821850231406320438 443987730869341283 968094201772616849 488975669567727438 758603464467250917 625363360911096780 85222314953925283 528659315330317043 845068857325619763 24516075549693939 964818298067918803 6209196574...

output:

4138877 14866002 49846340 103376855 107284342 174210645 175729306 219282588 230501185 241455603 243050857 313728829 332441216 349114639 444023117 499164029 584619048 634383459 664304399 670786725 691042113 760759272 780233946 815616879 844380809 912868017 980346392 1048287023 1249088452 1262451573 1...

result:

ok single line: '4138877 14866002 49846340 1033...9 72265656712794 73977818588700'

Test #17:

score: 0
Accepted
time: 36ms
memory: 7096kb

input:

131072
743940449621261352 897921156312947006 381866451310055691 510837325898530166 573942143778695038 607828391247621263 595520752882403134 426104232171225445 429518679563866799 848541322182140556 363679633028551853 916128372276069226 327175084861046892 381768612373046705 309147729542101493 76068458...

output:

25026997 48156682 70063189 120955699 138308952 142367826 270876851 309224522 344473622 373680539 419950623 505617396 544792515 560221934 675306971 754091061 894089720 898668239 916054934 962472007 1042347445 1062342969 1091550673 1101451024 1110039178 1113977162 1212700340 1216246881 1254284542 1468...

result:

ok single line: '25026997 48156682 70063189 120...2 79756255761926 87625626927619'

Test #18:

score: 0
Accepted
time: 36ms
memory: 6892kb

input:

131073
756677218771928662 874256759060265107 753231226286382997 592239065918791091 842361905938877771 493477384143414571 176320006835467534 812611238073716215 950643395956400235 287944461134456456 695435494917363934 652764161157479583 619460641773562961 940765243423628258 503490390085659463 69795343...

output:

99156494 101359575 102764812 108511176 276185996 305430462 397882036 419280129 568730398 570055654 572525187 699718759 726322407 829795023 833349989 833419900 916081607 940706777 955091298 1011289588 1041769965 1160106651 1189604280 1216687597 1230907457 1238090012 1298911238 1332670233 1366093655 1...

result:

ok single line: '99156494 101359575 102764812 1...5 73111115648245 81617476901984'

Test #19:

score: 0
Accepted
time: 22ms
memory: 8660kb

input:

199998
1000000000000000000 1000000000000000000 1 1000000000000000000 1 1 1 1 1000000000000000000 1000000000000000000 1 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1 1000000000000000000 1 1000000000000000000 1000000000000000000 1 1 1 1 1 1000000...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 999999999999999999'

Test #20:

score: 0
Accepted
time: 31ms
memory: 8744kb

input:

200000
1 1000000000000000000 1 1000000000000000000 1 1000000000000000000 1000000000000000000 1 1 1000000000000000000 1000000000000000000 1 1 1000000000000000000 1000000000000000000 1 1 1000000000000000000 1000000000000000000 1 1 1000000000000000000 1000000000000000000 1 1 1 1 1 1000000000000000000 1...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'

Test #21:

score: 0
Accepted
time: 42ms
memory: 8812kb

input:

200000
485930000000000000 317000000000000000 299290000000000000 500440000000000000 986515000000000000 93615000000000000 833915000000000000 392655000000000000 553510000000000000 593815000000000000 757985000000000000 161485000000000000 347920000000000000 12790000000000000 191395000000000000 6702650000...

output:

5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 5000000000000 500000...

result:

ok single line: '5000000000000 5000000000000 50...000 5000000000000 5000000000000'

Test #22:

score: 0
Accepted
time: 50ms
memory: 8868kb

input:

200000
499999997267010716 500000005514399081 500000000261048649 499999993006023100 499999999902681775 499999992921638311 500000000026193924 500000000097456384 499999994752591279 499999995839233984 499999997965809596 499999999717087600 500000006500068129 500000000154977601 500000004904200900 50000000...

output:

2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177...

result:

ok single line: '2 3 5 7 9 11 13 15 17 19 21 23...991 199993 199995 199997 199999'

Test #23:

score: 0
Accepted
time: 30ms
memory: 8672kb

input:

200000
1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000000000 1000000000000...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3792kb

input:

100
7155 628 9797 7275 4198 1262 805 6794 8223 335 7012 669 8163 5000 9740 7929 8398 4847 2714 5902 6600 2969 1831 6437 2105 5561 8743 7982 4214 1146 4662 1353 7532 7053 8132 3394 8163 3155 7879 2212 4473 5502 1895 4267 7038 2048 7227 6467 3486 497 9098 6427 2167 8583 4082 3276 9848 8504 8366 9535 5...

output:

0 4 7 10 10 11 13 15 15 16 18 19 29 29 29 32 33 41 42 46 48 49 51 51 53 53 56 59 59 60 76 78 83 87 91 93 100 102 106 117 118 118 121 131 161 181 214 232 315 349

result:

ok single line: '0 4 7 10 10 11 13 15 15 16 18 ...121 131 161 181 214 232 315 349'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3856kb

input:

1000
247473948127383745 720816518619525111 71494426595136567 807622267783495614 418769467377097623 829235322045006192 456439043357785513 737404149198971524 130805546461121010 395911082765846703 423339854969986345 616059869308668981 31522501139525856 41684427179707372 387694338558133235 8577219388970...

output:

1441559421868 3506653646086 4027223154915 4228047044473 4473180822902 4743659761066 5169172110284 6412287750547 6488820374835 6679752347195 6785889863094 7165281968967 7748985576337 7924870363394 9010791770590 10923786522954 12682712919007 12875045593592 15861376406099 17842637770361 18530742985210 ...

result:

ok single line: '1441559421868 3506653646086 40...70949522354090 5974371249697872'

Test #26:

score: 0
Accepted
time: 3ms
memory: 4232kb

input:

10000
887556258582367008 357792273620077422 735825339282745530 213130825018972818 718811972680207781 668346751033904404 837411873427550175 557953586026299104 76708702360938568 9571995634126038 530917759548570268 292313006522297958 441034142460118628 774838194653709017 865404575809463344 189159573302...

output:

4825720280 6931525822 8740339514 19881976897 38052471487 50314866366 59323737615 63508931301 64346706518 69519012188 73724102197 82179041043 94639141531 98314570186 103809362436 106454809604 109168080159 114948935973 117530052260 123015732557 130190014753 138004230778 141398511086 156958196388 15737...

result:

ok single line: '4825720280 6931525822 87403395...659739167561602 851374975587330'

Test #27:

score: 0
Accepted
time: 28ms
memory: 6020kb

input:

100000
555988247885347507 138305358449090448 415234246740727395 95279889666432237 74118134561410055 806785382011328564 970879262772751224 833302427814767262 19148077261241778 70599814218804440 204365981048471328 679936550861059501 65357423250622684 632675134781392601 885415516432946689 7710105890905...

output:

330553764 340226236 354685618 370133124 499976807 588025941 598988459 806176845 997714407 1042814599 1052252750 1137480101 1200531864 1333197388 1349227316 1425237425 1573137234 1786714478 1934718925 2061517781 2239114292 2255044493 2400188955 2495939790 2531770141 2564875226 2575396044 2611448044 2...

result:

ok single line: '330553764 340226236 354685618 ... 89791954328341 115122906521317'

Test #28:

score: 0
Accepted
time: 52ms
memory: 8680kb

input:

200000
528008313207899519 661954612705871649 385624848881859310 463452443976807917 249059305855196699 202704720584314032 984453100821033766 962198118072368209 382913360427791523 337287448277616056 934285663884259423 832679035802210711 475932410573030058 751048426250166275 418755228704919733 80846428...

output:

9468481 10539643 28995441 41817273 74849931 135541289 159587585 207584601 220967479 283527375 288096978 348567497 412202904 416221917 464076265 479520209 487426376 527912884 530291099 537607089 546918839 579391071 599743597 627167304 646253827 681154814 687308535 695588287 702282439 770102486 783292...

result:

ok single line: '9468481 10539643 28995441 4181...0 52291621681899 57175957018907'

Test #29:

score: 0
Accepted
time: 56ms
memory: 8636kb

input:

199999
258087401094333827 215752812320743807 870439910325160055 740341162833376696 518815733078374235 534675601107051079 822406715548899295 275398000797751526 589829099134259599 648039101087206329 590765370839497952 707371083661410094 428566245759767023 674504066483976562 267211353303551478 80502864...

output:

11425546 55478486 138645470 153934825 180049009 202520741 206521248 221519328 225027871 226795177 238503746 263337315 343204213 352782549 396367576 404089709 411727599 467028678 489171332 562842171 597635172 606689543 640703528 661557295 663090952 704286480 741297384 746826883 760205644 790461675 79...

result:

ok single line: '11425546 55478486 138645470 15...5 52441872081288 56811652623004'

Test #30:

score: 0
Accepted
time: 48ms
memory: 8588kb

input:

199998
159956766341994388 272982188231411352 666083969453621978 743709752322057048 576930643550462686 174121209300665945 805811035580139422 784045161567231910 99747076250620275 178371245005731153 776844303700312859 582482589975568795 859477536669443456 538733283474795431 162766577805472117 648895629...

output:

111051769 133539294 137660001 140445572 149567583 196703889 200519212 232864662 251666364 254182365 302309213 326428482 331154706 344719769 360296027 361293232 364126974 364227624 430075132 438341185 537748080 572153735 595489997 596502135 612515800 618040038 619396305 638562187 641684841 647465957 ...

result:

ok single line: '111051769 133539294 137660001 ...1 51446444812805 56344316665903'

Extra Test:

score: 0
Extra Test Passed