QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#882142#10049. Grid ColoringMousa_Aboubaker100 ✓319ms37168kbC++202.8kb2025-02-04 21:26:212025-02-04 21:26:21

Judging History

This is the latest submission verdict.

  • [2025-02-04 21:26:21]
  • Judged
  • Verdict: 100
  • Time: 319ms
  • Memory: 37168kb
  • [2025-02-04 21:26:21]
  • Submitted

answer

#pragma GCC optimize("O3", "Ofast", "unroll-loops")
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <deque>
#include <climits>
#include <cmath>
#include <numeric>
#include <string>
#include <bitset>
#include <assert.h>
#include <iomanip>
#include <bit>
using namespace std;

template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/
/*
#include <bits/stdc++.h>
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define getrand(l, r) uniform_int_distribution<int>(l, r)(rng)
*/

const long long infl = 1e18 + 1;
const int inf = 1e9 + 1;
const int mod1 = 1e9 + 7;
const int mod2 = 998244353;
const long double eps = 1e-7;
const int mod = mod1;

int add(int a, int b) { return (a + b) % mod; }
int sub(int a, int b) { return (a - b + mod) % mod; }
int mul(int a, int b) { return (int)((long long)a * b % mod); }
int pwr(int a, int b = mod - 2)
{
  int res = 1;
  for (; b > 0; b >>= 1, a = mul(a, a))
    if (b & 1)
      res = mul(res, a);
  return res;
}
template <typename T>
bool chmax(T &a, T b)
{
  if (b > a)
  {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T &a, T b)
{
  if (b < a)
  {
    a = b;
    return true;
  }
  return false;
}

#define all(x) x.begin(), x.end()
#define SZ(x) (int)x.size()
#define vec vector
using ll = long long;

void solve()
{
  int n;
  cin >> n;
  vec<int> a(n), b(n);
  for(auto &i: a)
    cin >> i;
  for(auto &i: b)
    cin >> i;
  map<int, long long> mp;
  for(auto i: a)
    mp[i]++;
  for(auto i: b)
    mp[i]++;
  mp[a[0]]--;
  priority_queue<tuple<int, int, int>> pq;
  for(int i = 1; i < n; i++)
  {
    pq.push({a[i], i, 0});
    pq.push({b[i], i, 1});
  }
  int mxx = 0, mxy = 0;
  while(not pq.empty())
  {
    auto [value, index, type] = pq.top();
    pq.pop();

    if(type)
    {
      mp[value] += max(0ll, (n - mxx - 1) * 1ll * (n - mxy - index));
      chmax(mxy, n - index);
    }
    else
    {
      mp[value] += max(0ll, (n - mxy - 1) * 1ll * (n - mxx - index));
      chmax(mxx, n - index);
    }
  }

  int mx_col = 0;
  long long mx_cnt = 0;
  for(auto [f, s]: mp)
  {
    if(s > mx_cnt)
      mx_cnt = s;
    if(s == mx_cnt)
      mx_col = f;
  }
  cout << mx_col << ' ' << mx_cnt;
}

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int t = 1;
  // cin >> t;
  while (t--)
  {
    solve();
    cout << (t ? "\n" : "");
  }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 15
Accepted

Test #1:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

500
443 443 567 680 1057 1143 1196 1213 1385 1534 1621 1741 1812 1944 2186 2861 2970 3022 3385 3451 3902 3968 4007 4048 4066 4109 4162 4997 5031 5043 5051 5311 5612 5735 5914 6068 6125 6269 6354 6683 7095 7134 7285 7500 7507 7550 7681 7829 7905 8039 8047 8111 8438 8453 8476 8842 8900 9051 9154 9224 ...

output:

443 501

result:

ok single line: '443 501'

Test #2:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

500
422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 422 ...

output:

99516 500

result:

ok single line: '99516 500'

Test #3:

score: 15
Accepted
time: 1ms
memory: 3712kb

input:

500
50386 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

100000 500

result:

ok single line: '100000 500'

Test #4:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

500
99982 154 297 421 661 1144 1253 1464 1502 1643 1789 2148 2204 2294 2414 3018 3117 3174 3332 3425 3515 3680 3836 3990 4216 4444 4561 4690 4960 5297 5365 5551 5673 5832 6199 6408 6723 6881 6961 7097 7401 7716 7948 8188 8323 8566 8714 8843 8933 9153 9236 9407 9433 9541 9600 9843 10089 10237 10297 1...

output:

99982 501

result:

ok single line: '99982 501'

Test #5:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

500
50386 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...

output:

50386 501

result:

ok single line: '50386 501'

Test #6:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

499
99982 40247 82451 27939 18276 46922 94930 98397 9859 63286 27272 83341 1692 13082 29600 16362 92897 32031 24632 26590 31547 89987 39960 65880 73359 6723 70481 32344 67427 67682 66872 43625 13895 20613 93346 37458 17922 48671 87620 98672 16903 97557 421 52482 29690 24684 25605 90417 51030 33129 9...

output:

99982 160856

result:

ok single line: '99982 160856'

Test #7:

score: 15
Accepted
time: 0ms
memory: 3584kb

input:

50
2776 3930 4215 5460 6837 8340 10927 12249 12321 15672 16267 19692 20279 20495 20860 23997 24542 26459 28391 29957 32125 34271 40231 43012 44708 45424 46465 49763 52957 53387 53427 54543 55108 59667 59879 60357 61203 61893 63131 63632 65489 66896 68782 73661 75114 79592 81603 85285 86201 92129
277...

output:

3930 51

result:

ok single line: '3930 51'

Test #8:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

50
6692 7372 9155 9608 9863 11759 13541 14336 14804 15492 16620 19146 20496 20713 21502 21985 23013 24156 24399 27487 27905 28046 29085 29595 31439 35056 39112 41056 41699 47511 50438 62162 63305 63389 65351 69922 70435 70971 73939 77701 78886 80826 83592 85259 86240 87964 92982 93735 94718 97992
66...

output:

7372 51

result:

ok single line: '7372 51'

Test #9:

score: 15
Accepted
time: 1ms
memory: 3712kb

input:

500
231 1497 3074 3105 3252 3279 3377 3887 3905 4131 4522 4786 4917 4978 5437 5645 5753 5954 6326 6517 6661 6807 7630 7715 8080 8138 8994 9746 10178 10208 10457 10643 10767 10852 10935 10937 11132 11133 11400 11464 11580 11661 11765 11809 11810 11831 11888 11964 12024 12100 12141 12471 12674 12917 1...

output:

1497 501

result:

ok single line: '1497 501'

Test #10:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

500
548 567 580 647 760 1350 1442 1460 1740 1921 2052 2155 2328 2573 2577 2758 2854 4261 4523 4717 4888 5824 6117 6195 6218 6512 6593 7019 7303 7689 7714 7762 8060 8124 8743 8759 8767 8798 9338 9434 9648 9832 9943 10051 10523 10591 10934 11026 11162 11360 11514 11545 11681 11788 11979 12204 12302 12...

output:

567 501

result:

ok single line: '567 501'

Test #11:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

50
161 964 2776 4096 4795 5460 6218 7361 8242 9419 10927 11599 12249 12482 14542 15672 16787 19585 20051 20495 21388 22667 23149 23997 24765 26730 28391 29957 32125 34049 34271 37125 40231 40477 40720 42599 43714 45424 46465 48625 49763 96125 96124 52648 53387 53950 54543 55826 56650 58701
161 2106 ...

output:

96125 803

result:

ok single line: '96125 803'

Test #12:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

500
89 231 351 503 903 1227 1390 1497 1717 1800 2002 2132 2545 2842 2959 3067 3105 3154 3279 3446 3671 3747 3814 3905 4074 4131 4404 4514 4786 4934 5218 5251 5437 5645 5838 5910 5926 5981 6258 6331 6420 6517 6690 6877 7194 7437 7514 7634 7732 7762 8138 8300 8374 8532 8636 8762 8958 9012 9304 9412 96...

output:

99976 76778

result:

ok single line: '99976 76778'

Test #13:

score: 15
Accepted
time: 1ms
memory: 3840kb

input:

500
70 205 484 567 647 802 823 1289 1300 1350 1388 1442 1548 1665 1740 1954 2029 2052 2155 2239 2328 2398 2577 2758 2854 2877 2996 3184 3294 3528 3678 3837 4202 4359 4523 4717 4888 4958 5110 5489 5641 5717 5824 6117 6218 6483 6512 6737 6936 7008 7043 7250 7459 7689 7762 8049 8068 8124 8147 8236 8337...

output:

99900 76778

result:

ok single line: '99900 76778'

Test #14:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1 250000

result:

ok single line: '1 250000'

Test #15:

score: 15
Accepted
time: 0ms
memory: 3840kb

input:

500
100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 10...

output:

100000 250000

result:

ok single line: '100000 250000'

Test #16:

score: 15
Accepted
time: 0ms
memory: 3584kb

input:

2
67954 66196
67954 97305

output:

97305 2

result:

ok single line: '97305 2'

Test #17:

score: 15
Accepted
time: 0ms
memory: 3584kb

input:

10
47934 85451 8162 23422 17053 26796 11747 22576 21189 65424
47934 12547 78204 5088 86580 72359 6726 52550 96390 78381

output:

86580 37

result:

ok single line: '86580 37'

Test #18:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

249
73191 82846 19963 3534 41421 57679 92454 16268 93964 59408 67548 2370 52771 24042 98496 28272 22975 67078 3412 7709 24115 22220 23695 2633 50348 48605 32365 55987 73329 56128 13138 78460 99004 43367 85813 41994 29877 471 57136 15388 30111 63273 71895 39899 61638 46219 73489 24348 10824 44660 528...

output:

99004 34123

result:

ok single line: '99004 34123'

Test #19:

score: 15
Accepted
time: 0ms
memory: 3712kb

input:

499
92639 78163 18386 49989 83133 1894 19178 28361 29329 6785 3602 15022 95438 58991 25999 8019 86983 76617 3311 1810 4563 95410 2561 87098 53709 24767 30345 40166 56049 4968 63660 68090 20283 68097 87417 6976 44583 71832 60871 3151 96920 27812 5024 42054 82574 57267 12366 66673 77923 79575 98587 31...

output:

99377 86017

result:

ok single line: '99377 86017'

Test #20:

score: 15
Accepted
time: 1ms
memory: 3584kb

input:

500
38039 12824 76536 45054 23735 32496 5555 50360 38974 59801 31517 60086 45281 171 54356 98311 89583 78500 37995 86809 7537 2280 68367 84609 34622 69740 54661 18715 17582 9618 4641 15183 77004 58295 84894 63007 47110 89552 41143 91641 68044 59820 39841 44382 16326 32002 52832 91487 46484 3872 1233...

output:

99878 124252

result:

ok single line: '99878 124252'

Subtask #2:

score: 10
Accepted

Test #21:

score: 10
Accepted
time: 0ms
memory: 3584kb

input:

500
4195946 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 600922 6...

output:

4195946 501

result:

ok single line: '4195946 501'

Test #22:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 821209 82...

output:

999171721 500

result:

ok single line: '999171721 500'

Test #23:

score: 10
Accepted
time: 0ms
memory: 3712kb

input:

500
500000175 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

1000000000 500

result:

ok single line: '1000000000 500'

Test #24:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
999856969 793616 3959339 6360069 8347366 13844077 18716337 22823845 24911840 25171113 25949852 26956337 28238108 30311756 34315950 38880069 40443951 45518491 46524493 50019693 51285901 51793241 52906838 53339762 56921442 58550329 58950857 62809176 64950417 66828945 69361936 70621553 71428801 733...

output:

999856969 501

result:

ok single line: '999856969 501'

Test #25:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
500000175 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

500000175 501

result:

ok single line: '500000175 501'

Test #26:

score: 10
Accepted
time: 1ms
memory: 3840kb

input:

499
999856969 678578804 389805473 958779782 453423515 510167474 455583653 364725870 511170382 581099155 928196996 193186548 109100099 390333007 193230517 822021582 531472637 986389058 418493146 405852528 853621749 929211287 976018300 823294313 832860998 331912040 246790418 220980901 733844236 120252...

output:

999856969 195218

result:

ok single line: '999856969 195218'

Test #27:

score: 10
Accepted
time: 0ms
memory: 3712kb

input:

50
23164855 40409343 86691596 89894360 140524314 142550853 179577103 219503831 224400149 238924739 243220198 252467865 292696384 307690163 331677875 404642365 426541619 457748715 488908766 560977536 594789355 621377538 645718761 654564347 655765225 665586974 670071138 673468101 718515000 719049375 7...

output:

40409343 51

result:

ok single line: '40409343 51'

Test #28:

score: 10
Accepted
time: 0ms
memory: 3712kb

input:

500
4463546 7151926 11024375 11754012 11860281 13271497 14060099 15581917 20581900 21133790 21978455 23349633 24125933 26544042 28753633 30169720 30265359 32918513 33857828 35117365 37449843 40833429 45684894 47226057 48470060 49713218 50420938 59473181 60517807 62273330 64383001 65967824 70468994 7...

output:

7151926 501

result:

ok single line: '7151926 501'

Test #29:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
1866997 6860418 11055972 13483486 14461793 16518627 17434587 21389790 21514756 22590313 23312503 27417808 30054812 30433211 33437220 33660305 33946090 34065048 35082258 36298281 38231364 38581798 39703720 41144474 43098189 43121262 44970615 46800090 48820454 50598289 50711441 52377097 55357217 5...

output:

6860418 501

result:

ok single line: '6860418 501'

Test #30:

score: 10
Accepted
time: 0ms
memory: 3584kb

input:

50
3489837 13123712 23164855 50618326 72130254 89894360 110963500 115160907 123449387 133700463 142118070 145390181 153203574 187654727 219503831 238924739 252467865 261181826 275908000 307690163 331677875 350632981 360283846 371377367 377184963 390792320 422354063 438263262 464568412 480610021 4889...

output:

978816525 803

result:

ok single line: '978816525 803'

Test #31:

score: 10
Accepted
time: 0ms
memory: 3840kb

input:

500
741684 2893894 4463546 5520958 7072387 7554810 9861634 11024375 11754012 12075397 13271497 14060099 14799738 17348009 19723411 20581900 21133790 22362804 23666171 24441696 27727637 28742656 28978181 29565548 30169720 31176870 32918513 33146290 34588283 35251472 37517499 39992773 40729787 4395630...

output:

999928857 76778

result:

ok single line: '999928857 76778'

Test #32:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
75894 1866997 3747566 3843975 6610466 6884810 11434479 12106352 13483486 14982157 16518627 17972667 20246765 21123307 21514756 22590313 27417808 29325761 30054812 31782380 33437220 33946090 34368769 35237178 37285921 38197851 38581798 40019037 42293714 43098189 44558112 46394795 46691862 4882045...

output:

999693699 76778

result:

ok single line: '999693699 76778'

Test #33:

score: 10
Accepted
time: 1ms
memory: 3712kb

input:

500
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000...

output:

1000000000 250000

result:

ok single line: '1000000000 250000'

Test #34:

score: 10
Accepted
time: 1ms
memory: 3584kb

input:

10
869607951 318833796 197423401 820985380 644944082 658583443 412098362 758161984 33153573 807731482
869607951 759478903 531361223 274425607 448687994 258055665 896665848 825851793 922650176 818363507

output:

820985380 36

result:

ok single line: '820985380 36'

Test #35:

score: 10
Accepted
time: 0ms
memory: 3840kb

input:

249
489774418 524277760 632500119 65011913 570181275 913663640 90857995 223532880 347169375 21784382 740228723 644631544 354964122 239358153 567358682 65905082 751312095 725817388 456263638 901282642 232553215 240053371 484624992 213226763 938661402 162465721 981666611 881689475 209930339 299687177 ...

output:

996390019 30753

result:

ok single line: '996390019 30753'

Test #36:

score: 10
Accepted
time: 1ms
memory: 3840kb

input:

499
593479012 57763361 127343941 699444934 2982628 485049286 129275790 883508025 294959791 462358669 829389223 817513893 149173993 915343004 87185318 96175523 95284550 477552414 17042427 62390905 507567801 247967318 913609029 70389126 586636298 299668457 970341640 633453703 176053540 243687296 77330...

output:

999011645 76693

result:

ok single line: '999011645 76693'

Test #37:

score: 10
Accepted
time: 0ms
memory: 3712kb

input:

500
459922656 502982040 648812811 974278290 419385230 307877676 847098520 405911662 694397864 245779546 507531755 307904306 238738624 577641211 150039531 59923474 544009503 687497002 563550931 340621011 435135650 30516850 550754580 189739355 344363417 261976366 559223469 929903367 590476791 26923232...

output:

999502278 224052

result:

ok single line: '999502278 224052'

Subtask #3:

score: 20
Accepted

Test #38:

score: 20
Accepted
time: 11ms
memory: 5344kb

input:

47321
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

1 1119638521

result:

ok single line: '1 1119638521'

Test #39:

score: 20
Accepted
time: 64ms
memory: 12172kb

input:

199999
2 1 2 2 2 1 1 2 1 1 1 2 2 1 2 1 1 1 1 1 1 2 2 1 1 1 2 1 2 2 2 1 2 1 2 1 2 2 1 1 1 2 1 2 2 2 1 1 1 2 2 1 1 1 1 1 2 2 1 1 1 1 2 1 1 2 1 1 2 1 2 1 1 1 2 2 1 2 1 2 1 2 2 2 2 2 2 2 1 1 1 2 2 1 2 2 1 2 2 2 1 2 1 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 2 2 2 2 1 2 2 1 2 1 2 1 1 1 1 1 1 1 1 2 1 2 1 2 2 1 2 2...

output:

2 39999400146

result:

ok single line: '2 39999400146'

Test #40:

score: 20
Accepted
time: 60ms
memory: 12164kb

input:

200000
2 2 1 1 1 2 2 2 1 2 2 1 1 1 2 1 2 2 1 1 2 2 1 1 1 2 1 2 1 2 2 1 1 2 1 1 2 1 2 1 1 1 1 2 2 1 1 1 1 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 1 1 1 1 1 2 2 2 2 1 2 1 1 1 1 1 1 2 1 1 2 1 1 2 2 1 1 1 1 2 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 2 1 2 2 1 1 1 2 1 1 1 1 2 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 1 2 1 2 1 1 1 2 2 2...

output:

2 39999800282

result:

ok single line: '2 39999800282'

Test #41:

score: 20
Accepted
time: 53ms
memory: 12164kb

input:

200000
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

2 39999600003

result:

ok single line: '2 39999600003'

Test #42:

score: 20
Accepted
time: 55ms
memory: 12164kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

2 20000000000

result:

ok single line: '2 20000000000'

Test #43:

score: 20
Accepted
time: 55ms
memory: 12164kb

input:

200000
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1 20000000006

result:

ok single line: '1 20000000006'

Test #44:

score: 20
Accepted
time: 54ms
memory: 12168kb

input:

200000
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1 20000000001

result:

ok single line: '1 20000000001'

Test #45:

score: 20
Accepted
time: 57ms
memory: 12172kb

input:

200000
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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1 39999600000

result:

ok single line: '1 39999600000'

Test #46:

score: 20
Accepted
time: 53ms
memory: 12168kb

input:

200000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1 40000000000

result:

ok single line: '1 40000000000'

Test #47:

score: 20
Accepted
time: 55ms
memory: 12168kb

input:

200000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

2 40000000000

result:

ok single line: '2 40000000000'

Test #48:

score: 20
Accepted
time: 30ms
memory: 7636kb

input:

99999
1 2 2 1 2 1 2 2 1 2 2 1 2 1 1 1 1 1 2 2 2 2 2 2 1 2 1 1 1 2 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 2 2 1 2 1 2 2 1 1 2 2 1 2 2 2 2 1 2 2 1 2 2 1 2 2 1 1 1 2 1 2 2 2 1 2 1 1 2 2 1 2 1 1 1 2 2 1 1 2 1 2 1 2 1 1 1 1 2 2 2 1 1 2 1 1 2 1 2 1 1 1 2 2 2 2 1 2 1 1 1 2 1 1 2 2 1 2 2 2 1 1 1 1 1 1 1 1 1 2 2 2 2 ...

output:

2 9999699807

result:

ok single line: '2 9999699807'

Test #49:

score: 20
Accepted
time: 63ms
memory: 12040kb

input:

199999
1 1 2 2 2 1 1 2 2 2 1 1 1 2 1 2 1 2 1 2 1 1 2 2 1 2 1 1 2 1 2 1 1 1 1 2 2 2 2 1 2 2 1 1 1 1 1 1 1 2 2 2 1 1 2 2 2 1 1 2 1 2 1 1 1 2 2 1 2 1 1 1 2 1 2 2 1 2 1 2 1 2 2 2 1 1 2 2 2 2 2 1 2 1 1 2 2 2 1 1 2 2 1 1 1 2 1 2 1 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 1 2 1 2 2 1 1 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2...

output:

2 39999400506

result:

ok single line: '2 39999400506'

Test #50:

score: 20
Accepted
time: 65ms
memory: 12164kb

input:

200000
2 2 1 1 2 1 1 2 2 1 2 1 1 1 2 2 1 1 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 2 2 2 1 2 1 2 2 2 1 2 1 2 2 2 2 1 2 1 1 1 1 2 1 2 2 1 1 1 1 1 2 2 1 1 1 1 2 1 2 1 2 2 2 1 2 2 1 1 1 1 1 2 1 2 1 2 2 1 1 1 2 2 2 2 2 1 1 2 1 1 2 2 2 1 2 1 2 2 1 1 1 1 1 1 2 1 1 2 2 1 2 1 2 2 1 1 1 1 1 2 2 1 1 1 1 2 2 2 2 2 2 1 1...

output:

2 39999800031

result:

ok single line: '2 39999800031'

Subtask #4:

score: 25
Accepted

Test #51:

score: 25
Accepted
time: 176ms
memory: 37168kb

input:

200000
920 1463 4431 7058 11118 13005 30856 33341 34539 39227 40209 43007 43510 49602 51105 55241 55810 56016 57083 58973 60147 62082 62452 68622 70787 73408 79126 83852 86224 91963 94622 97983 98446 99211 100001 100206 101048 101583 104042 105734 109201 111247 112684 114852 116012 117918 119202 122...

output:

999995694 200000

result:

ok single line: '999995694 200000'

Test #52:

score: 25
Accepted
time: 171ms
memory: 30756kb

input:

200000
5687 9695 10266 10345 16160 24076 24616 31143 34182 34526 40968 42956 44657 45950 48493 50834 51534 54744 55244 56365 57777 57947 58512 59013 66028 69671 72602 77463 78124 78463 79210 86781 88286 89453 93411 97246 97981 98321 102450 103304 104657 105085 106410 107257 108687 109910 115324 1188...

output:

333597477 200001

result:

ok single line: '333597477 200001'

Test #53:

score: 25
Accepted
time: 173ms
memory: 37164kb

input:

199999
412 2144 2215 9873 10040 13662 15722 15951 17079 18990 28848 29035 29760 31310 31417 35335 36147 38544 40785 42797 43190 45521 48557 57312 61158 63866 71190 71819 71838 74730 75236 78238 78402 80360 80680 82523 82862 82929 84967 86128 86997 93798 95951 96146 96721 97939 98451 99142 101129 108...

output:

499564392 200000

result:

ok single line: '499564392 200000'

Test #54:

score: 25
Accepted
time: 0ms
memory: 3840kb

input:

500
312 395 469 532 613 906 909 1006 1364 1399 1402 1433 1668 1706 1736 1872 2165 2389 2462 2704 2755 2793 2796 2904 2909 3137 3149 3185 3353 3762 3763 4166 4190 4204 4339 4474 4647 4670 4768 4915 5276 5594 6000 6078 6157 6254 6268 6392 6429 6455 6515 6522 6887 6922 6948 6977 7074 7344 7490 7538 758...

output:

34074 501

result:

ok single line: '34074 501'

Test #55:

score: 25
Accepted
time: 0ms
memory: 3840kb

input:

500
26 61 517 556 566 589 612 627 693 728 770 788 1056 1105 1132 1212 1267 1268 1280 1492 1651 1829 1949 1966 2258 2262 2396 2669 2761 2916 2984 3009 3037 3044 3235 3263 3386 3400 3501 3629 3831 3896 4046 4059 4103 4107 4257 4310 4424 4503 4783 4837 4894 4963 5077 5184 5304 5336 5564 5640 5791 5948 ...

output:

99711 500

result:

ok single line: '99711 500'

Test #56:

score: 25
Accepted
time: 151ms
memory: 24668kb

input:

200000
999800001 999800002 999800003 999800004 999800005 999800006 999800007 999800008 999800009 999800010 999800011 999800012 999800013 999800014 999800015 999800016 999800017 999800018 999800019 999800020 999800021 999800022 999800023 999800024 999800025 999800026 999800027 999800028 999800029 999...

output:

1000000000 399999

result:

ok single line: '1000000000 399999'

Test #57:

score: 25
Accepted
time: 82ms
memory: 20304kb

input:

99999
3142 10601 11118 18747 26626 31787 45123 48256 49710 51806 54602 61353 74872 115154 117011 138785 154400 167639 173792 174318 186683 194226 199241 216762 225562 235788 236488 236519 242603 243442 243917 248062 266018 268389 279807 282821 296270 309487 309914 311647 316987 317146 336571 355908 ...

output:

993595945 198684

result:

ok single line: '993595945 198684'

Test #58:

score: 25
Accepted
time: 175ms
memory: 37164kb

input:

199999
522 2425 3621 11371 15769 16794 17230 22606 22919 28138 29020 31861 32075 37488 37539 41047 46691 50435 50768 51449 52907 55709 56265 70205 74461 79584 82053 83030 84277 92700 92757 96661 102014 103364 104450 106650 106947 112682 113256 114992 116224 125903 126349 129404 132456 138288 157943 ...

output:

962827952 384874

result:

ok single line: '962827952 384874'

Test #59:

score: 25
Accepted
time: 179ms
memory: 37160kb

input:

200000
433 1220 11649 17801 20219 24324 26010 29423 30825 31543 41913 51077 52105 53494 56990 58105 64226 73171 74776 76800 80172 81940 83783 87464 100585 101242 108146 111441 111931 114564 114977 116176 116497 118415 126375 136492 151274 151322 159160 162484 172118 180821 187208 195499 208546 20928...

output:

978179660 391192

result:

ok single line: '978179660 391192'

Test #60:

score: 25
Accepted
time: 173ms
memory: 37164kb

input:

200000
456 819 2386 6513 9970 13223 17963 21403 26376 33138 35413 39595 54006 54374 58887 60973 68895 72585 81762 82295 87982 93676 97060 98955 99127 101737 102344 105494 106228 120944 122631 131323 132506 133314 140791 141614 147216 147715 148948 150886 155552 161903 164006 165315 167772 185471 192...

output:

999575222 399847

result:

ok single line: '999575222 399847'

Test #61:

score: 25
Accepted
time: 168ms
memory: 37016kb

input:

200000
2841 11055 13346 14357 19011 20818 33351 35320 40804 42546 50511 59255 62070 67823 77873 79453 81617 88969 98801 106387 109963 111209 115148 116998 118545 121913 128348 132719 138338 142214 142374 149223 157503 163795 178599 183466 187648 196021 198534 209395 212832 222928 224769 231978 23686...

output:

999998103 200000

result:

ok single line: '999998103 200000'

Test #62:

score: 25
Accepted
time: 171ms
memory: 37168kb

input:

200000
556 5237 7150 11644 16258 16636 38587 47898 52330 53345 58111 59664 63720 70236 77238 80633 95114 97018 100383 102939 104293 112924 122826 128422 129185 136307 140325 143064 151828 160559 164318 169434 175258 182431 184159 192356 193531 202149 207407 210939 215890 219180 227026 230120 236464 ...

output:

999999553 200000

result:

ok single line: '999999553 200000'

Subtask #5:

score: 30
Accepted

Test #63:

score: 30
Accepted
time: 116ms
memory: 24500kb

input:

200000
14788 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 9714 97...

output:

14788 200001

result:

ok single line: '14788 200001'

Test #64:

score: 30
Accepted
time: 125ms
memory: 24672kb

input:

200000
7592 10647 12202 18910 20019 22476 23681 24457 25222 25530 38396 43068 47172 60367 61133 65809 77851 80815 86221 90021 94965 103145 105362 107509 109518 118658 125856 132367 144055 148495 153157 154214 156356 157657 160798 160920 174264 182075 183747 186604 199358 199772 201119 213377 219989 ...

output:

999985769 200000

result:

ok single line: '999985769 200000'

Test #65:

score: 30
Accepted
time: 126ms
memory: 24668kb

input:

200000
1174 3744 1174 11642 24260 30531 41383 43894 66261 77466 85875 95505 98701 104138 104667 115998 116971 122161 125769 129315 129542 129555 133028 134834 139623 140190 148909 149175 152789 154677 157402 173811 187580 192415 193152 198063 200960 225039 227084 236046 238450 243892 256869 257318 2...

output:

3744 399999

result:

ok single line: '3744 399999'

Test #66:

score: 30
Accepted
time: 189ms
memory: 37164kb

input:

200000
500106375 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...

output:

1000000000 200000

result:

ok single line: '1000000000 200000'

Test #67:

score: 30
Accepted
time: 174ms
memory: 37164kb

input:

199999
999997861 11821 22020 25513 26662 38328 45245 50381 54215 58598 59579 62460 70953 80407 89485 94898 96923 101231 105914 108338 114212 114595 123799 125561 128951 134596 143355 148226 151328 154558 161411 163577 168299 169274 173671 176403 185141 192396 198518 203601 207150 207721 212554 21502...

output:

999997861 200000

result:

ok single line: '999997861 200000'

Test #68:

score: 30
Accepted
time: 174ms
memory: 37168kb

input:

200000
999992977 5151 11665 27483 39807 44677 46604 52819 57979 62115 66766 67638 70103 75637 78995 84656 88621 92486 96619 109955 116436 123517 126570 132409 138108 141314 153952 155189 157532 161624 171998 180184 183174 184436 185179 192940 211866 219842 223339 227677 229985 230743 234681 245060 2...

output:

999992977 200001

result:

ok single line: '999992977 200001'

Test #69:

score: 30
Accepted
time: 195ms
memory: 37168kb

input:

200000
500153258 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ...

output:

500153258 200001

result:

ok single line: '500153258 200001'

Test #70:

score: 30
Accepted
time: 310ms
memory: 36988kb

input:

199999
999997544 987064979 616759740 444658789 448542477 695734182 734970187 492910953 309433174 742149174 190861328 728976355 77305925 611886525 344370191 880896665 488808347 194221647 710192623 126741301 381262377 165268312 247179590 138165428 532558151 696289192 328372241 49314716 555432252 97220...

output:

999997544 35537844620

result:

ok single line: '999997544 35537844620'

Test #71:

score: 30
Accepted
time: 175ms
memory: 25792kb

input:

200000
26233 31419 32865 35499 38696 48725 49055 51067 52263 52946 56315 58803 67940 68389 69624 74949 79152 80307 83871 88877 89308 95084 95618 99601 105045 106396 111216 113283 119570 121749 124623 126242 134345 140847 152730 154081 157440 159744 160625 162804 168170 173078 176510 182053 185947 18...

output:

31419 200001

result:

ok single line: '31419 200001'

Test #72:

score: 30
Accepted
time: 169ms
memory: 25288kb

input:

200000
13340 13618 18454 25155 30441 34055 38914 42921 48569 48864 49392 61879 70635 71105 74749 83496 89918 91969 97402 109548 113720 114733 117152 119103 122360 128561 130644 133200 133243 146371 154373 155676 158989 159934 161173 162990 164327 166469 174450 180271 183710 188009 194141 196419 2036...

output:

13618 200001

result:

ok single line: '13618 200001'

Test #73:

score: 30
Accepted
time: 166ms
memory: 25480kb

input:

200000
21785 23118 26012 28951 32689 42680 49325 49581 53439 56280 79010 80282 80974 92110 92832 96775 117300 117838 119287 123197 123622 126145 127229 129602 133825 140698 148688 149310 150069 152225 158532 170264 171922 174040 193622 200398 208102 218832 219751 227263 228314 234047 236898 248848 2...

output:

23118 200001

result:

ok single line: '23118 200001'

Test #74:

score: 30
Accepted
time: 164ms
memory: 37168kb

input:

200000
12275 18045 20411 29710 32865 34932 37442 41231 44257 45208 48725 51067 52263 52511 56315 58803 61398 66671 67940 69624 77114 79506 83539 84477 88989 95084 98102 99129 102026 105045 108410 111216 112490 114086 119086 120743 121989 126242 127952 134345 135081 138866 140847 143092 144507 152730...

output:

999997003 12222377778

result:

ok single line: '999997003 12222377778'

Test #75:

score: 30
Accepted
time: 164ms
memory: 37120kb

input:

200000
364 6101 8864 12976 13340 17819 18455 25155 31037 34055 38914 42921 48569 49392 58977 61004 65061 70635 71773 74204 76992 80341 83496 90012 91969 95611 98409 102362 105263 109548 113720 117152 122360 125937 128561 130644 132507 133243 135880 140078 141916 146371 154373 157471 158989 159934 16...

output:

999995185 12222377778

result:

ok single line: '999995185 12222377778'

Test #76:

score: 30
Accepted
time: 163ms
memory: 37168kb

input:

200000
8062 12604 14882 17960 21785 22420 26012 28951 32689 35163 39966 40923 44157 49581 53439 56280 65564 71208 74161 79010 80282 92032 92832 97048 104162 110869 116636 117838 123197 123902 126145 127392 130345 133611 135164 138042 140698 144700 148688 149966 150203 152225 158259 165169 169753 171...

output:

999997964 12222377778

result:

ok single line: '999997964 12222377778'

Test #77:

score: 30
Accepted
time: 64ms
memory: 12164kb

input:

200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000...

output:

1000000000 40000000000

result:

ok single line: '1000000000 40000000000'

Test #78:

score: 30
Accepted
time: 122ms
memory: 20300kb

input:

99999
68614976 671896320 98223355 706183697 305253894 760602613 423114327 87877202 581676310 449349539 464811658 879472364 816584728 184986190 141971261 9323267 21642847 964033264 434588927 842484190 36416962 438694185 826794385 113309489 104760982 26833526 988764574 930340926 414975951 406869507 72...

output:

999992529 9500662016

result:

ok single line: '999992529 9500662016'

Test #79:

score: 30
Accepted
time: 319ms
memory: 37160kb

input:

199999
862758467 722367793 921882443 954450627 328192446 191157704 873934719 376069384 773881137 440893957 9281004 927824181 346504963 724050003 181158309 973951531 394208583 721683330 238510488 593572986 957030902 539137210 511106804 337993226 709499494 513199536 661051408 575644529 29027375 582831...

output:

999997437 29129908699

result:

ok single line: '999997437 29129908699'

Test #80:

score: 30
Accepted
time: 316ms
memory: 37168kb

input:

200000
666988483 98169520 276874194 844074938 343962402 413688049 231685730 450170012 194033195 235892482 936255376 760682048 912714096 773635220 930598619 718220518 737334364 746641034 784553039 695827314 241762105 808744171 279897953 343651926 774692319 745148216 776735617 878941884 981569266 3496...

output:

999995029 23027084865

result:

ok single line: '999995029 23027084865'

Test #81:

score: 30
Accepted
time: 293ms
memory: 37036kb

input:

200000
54119743 497962519 975226960 963464008 193543206 783433567 268264750 252607262 295568869 73689337 802672440 454554020 49860794 471059257 832613107 199888947 82346225 492815063 815693826 27226699 889625048 518270973 693389788 679301063 850548484 83580635 933353116 558681487 402551523 341639912...

output:

999992305 15941520293

result:

ok single line: '999992305 15941520293'

Extra Test:

score: 0
Extra Test Passed