QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#88777#4819. Just Another Number Theory ProblemOlegpresnyakovAC ✓81ms3812kbC++141.9kb2023-03-17 10:09:022023-03-17 10:09:04

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-17 10:09:04]
  • 评测
  • 测评结果:AC
  • 用时:81ms
  • 内存:3812kb
  • [2023-03-17 10:09:02]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <fstream>
#include<time.h>
#include <unordered_map>
#include <cstdlib>
#include <string.h>
#include <bitset>
#include <unordered_set>
#include <cstdlib>
#include <cassert>
#include <queue>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i < (n); ++i)
#define rep1n(i, n) for(int i = 1; i <= (n); ++i)
#define repr(i, n) for(int i = (n) - 1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) (int)(a.size())
#define each(x, a) for(auto &x : a)
#define ar array
#define int long long
 
using namespace std;
 
int Bit(int mask, int b) { return (mask >> b) & 1; }
 
template<class T> bool ckmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T> bool ckmax(T &a, const T &b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}

//__builtin_popcount = int
//__builtin_popcountl = long int
//__builtin_popcountll = long long

const int mod = 998244353;

void solve(){
    int n;
    cin >> n;
    vector<int> p(n);
    for(int i = 0; i < n; ++i){
        cin >> p[i];
    }

    int sum = 0;
    for(int i = 0; i <= p[0] - 1; ++i){
        int ans = 1 + (i > 0 ? 1 : 0);
        for(int j = 0; j < n; ++j){
            ans *= ((p[j] - i) % mod);
            ans %= mod;
            ans += mod;
            ans %= mod;
        }

        sum += ans;
        sum %= mod;
        sum += mod;
        sum %= mod;
    }

    cout << sum % mod << "\n";
}

signed main(){
    ios_base::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);

    int t = 1;
    while(t--) {
        solve();
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3340kb

input:

2
2 5

output:

18

result:

ok 1 number(s): "18"

Test #2:

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

input:

3
5 7 233

output:

31275

result:

ok 1 number(s): "31275"

Test #3:

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

input:

1
3

output:

9

result:

ok 1 number(s): "9"

Test #4:

score: 0
Accepted
time: 2ms
memory: 3480kb

input:

2
5 23

output:

535

result:

ok 1 number(s): "535"

Test #5:

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

input:

3
2 3 5

output:

46

result:

ok 1 number(s): "46"

Test #6:

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

input:

4
3 5 7 59

output:

13473

result:

ok 1 number(s): "13473"

Test #7:

score: 0
Accepted
time: 2ms
memory: 3348kb

input:

5
3 11 17 19 53

output:

1398057

result:

ok 1 number(s): "1398057"

Test #8:

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

input:

6
3 7 11 13 17 19

output:

2051859

result:

ok 1 number(s): "2051859"

Test #9:

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

input:

6
23 29 31 41 43 47

output:

248098855

result:

ok 1 number(s): "248098855"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

8
2 3 7 11 19 29 41 43

output:

652005606

result:

ok 1 number(s): "652005606"

Test #11:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

9
3 5 11 13 17 19 29 47 53

output:

639137187

result:

ok 1 number(s): "639137187"

Test #12:

score: 0
Accepted
time: 2ms
memory: 3324kb

input:

10
2 7 23 29 37 41 47 53 59 67

output:

741639722

result:

ok 1 number(s): "741639722"

Test #13:

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

input:

10
7 11 17 29 31 37 41 47 53 79

output:

130554824

result:

ok 1 number(s): "130554824"

Test #14:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

20
2 7 17 23 29 31 37 83 89 101 103 109 113 127 131 137 139 149 163 199

output:

617707828

result:

ok 1 number(s): "617707828"

Test #15:

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

input:

30
2 5 7 17 23 31 37 41 43 59 73 83 103 109 113 139 149 151 173 197 211 227 229 233 251 257 269 271 281 293

output:

42172932

result:

ok 1 number(s): "42172932"

Test #16:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

50
2 23 29 37 41 43 53 67 83 89 97 109 113 137 139 149 151 157 173 179 181 191 197 199 223 233 239 241 251 269 281 283 293 307 313 331 337 347 353 359 367 373 389 397 409 457 461 463 467 479

output:

713703182

result:

ok 1 number(s): "713703182"

Test #17:

score: 0
Accepted
time: 2ms
memory: 3432kb

input:

100
2 3 7 17 19 23 43 47 79 83 101 109 149 151 163 167 193 233 257 263 293 307 311 317 331 421 461 463 467 491 557 617 631 653 673 719 827 911 953 1013 1021 1031 1049 1063 1097 1103 1109 1117 1181 1201 1217 1249 1259 1301 1303 1307 1327 1489 1499 1567 1627 1657 1667 1723 1747 1759 1787 1831 1877 190...

output:

69515875

result:

ok 1 number(s): "69515875"

Test #18:

score: 0
Accepted
time: 2ms
memory: 3328kb

input:

200
31 43 53 59 61 67 83 97 103 107 137 163 167 241 359 389 479 593 601 683 701 733 769 797 863 883 887 991 1039 1093 1123 1151 1163 1229 1237 1301 1321 1327 1429 1481 1531 1543 1619 1621 1627 1637 1759 1811 1873 1877 1907 1949 1993 2027 2053 2063 2087 2099 2113 2129 2143 2221 2333 2347 2357 2381 24...

output:

319856386

result:

ok 1 number(s): "319856386"

Test #19:

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

input:

100
13 119363 147661 163981 182681 275161 330697 336829 418637 433847 460903 649619 675239 770993 877399 1121699 1136617 1232171 1353679 1426157 1470067 1781693 1849933 1967369 2228081 2243077 2279153 2407231 2611663 2903633 2938241 3158167 3256313 3501209 3524243 3575251 3679211 3898463 4048229 406...

output:

864286417

result:

ok 1 number(s): "864286417"

Test #20:

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

input:

2
83 831515409522078991

output:

573953298

result:

ok 1 number(s): "573953298"

Test #21:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

100
53 37396994767456229 40698058978692571 40758726606569129 55673709898097999 60025443958658201 69411844604405197 87940520293054271 89060075990091149 93582837716729467 104192132230953341 112805988553908469 133852318342202659 137406946779604367 196580141236570601 208351223666224517 22490278180711179...

output:

81947760

result:

ok 1 number(s): "81947760"

Test #22:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

200
13 29 769 2207 2441 2477 2707 3041 3307 3313 3719 4013 4133 4337 4363 4583 4787 5903 6563 6971 7213 7793 8209 8467 10303 10883 11047 11131 12491 12799 13331 13883 13967 14051 15061 15161 15391 15607 16067 17519 17827 18127 19087 19121 19471 20323 20509 21193 21277 22031 22271 22483 22567 22783 2...

output:

855246693

result:

ok 1 number(s): "855246693"

Test #23:

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

input:

300
43 491 1117 1297 4111 4133 4283 4871 5437 6311 6481 6619 6823 7517 7717 8887 9973 10159 10613 10949 12037 12379 12553 12841 13219 13327 13339 14221 14533 16193 16567 16691 17497 18217 18553 20753 21397 21433 21587 22447 23201 23911 24509 24851 25621 26393 27143 27953 28309 28751 28771 28961 2961...

output:

233255535

result:

ok 1 number(s): "233255535"

Test #24:

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

input:

500
89 109 479 547 887 941 1103 1171 1181 2099 2113 2539 3583 3593 3613 3803 3821 4373 4463 5231 5441 5987 6143 6329 6389 6581 6691 6763 7207 7253 7459 7853 8111 8161 8221 8317 8461 8573 8597 9871 10093 10343 10501 10687 11119 11261 12601 12703 13109 13337 14143 15101 15377 15461 16619 17191 17207 1...

output:

961677367

result:

ok 1 number(s): "961677367"

Test #25:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

1000
23 43 71 223 241 281 461 709 773 883 971 1061 1231 1483 1489 1667 1693 1889 1931 2141 2297 2417 2437 2687 2749 2801 2819 3019 3407 3539 3637 3769 3793 3797 4001 4111 4787 4933 4973 5273 5417 5557 5693 5807 6151 6379 6691 7109 7129 7583 7607 7691 7793 8059 8221 8269 8311 8933 9203 9227 9283 9421...

output:

396358323

result:

ok 1 number(s): "396358323"

Test #26:

score: 0
Accepted
time: 2ms
memory: 3504kb

input:

10000
37 53 163 223 283 739 991 1181 1231 1489 1621 1783 1931 2281 2347 2549 3319 3557 3767 4177 4649 4969 5209 5279 5479 5651 5657 6317 6637 7177 7417 7547 7607 8237 8599 8719 9907 10301 10337 10457 10627 10909 11159 11411 11939 12379 12791 13451 14321 14657 14669 14783 14929 15383 15511 16139 1619...

output:

691196623

result:

ok 1 number(s): "691196623"

Test #27:

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

input:

10000
53 179 881 2777 3229 3733 3923 4139 4211 4831 4973 6089 6337 6553 7681 7687 7753 8849 9431 11287 11399 12241 12289 12343 12823 13009 13093 13187 13781 14323 14653 15377 15797 19319 20011 20771 20773 20809 22307 22721 23357 23417 25457 26981 27061 27481 27947 28051 28057 28309 29201 29389 29753...

output:

996934415

result:

ok 1 number(s): "996934415"

Test #28:

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

input:

10000
5 60429212140307 91964233421183 126429220383337 200665877322439 507365134609789 528320113591427 740762228690531 755580479591843 808605059008843 907176727547957 917892018139007 926814583827931 938497350090121 1212768054371021 1344414768513863 1360812688175279 1492506476602861 1534810454634497 1...

output:

534803011

result:

ok 1 number(s): "534803011"

Test #29:

score: 0
Accepted
time: 13ms
memory: 3480kb

input:

20000
59 14693924045431 75440956833017 157195574658851 157365967298699 189220611334571 210163981863733 245397579799231 264292835318623 279447690933227 342741395129117 351719671801943 372977980199717 427015437133403 484681247923207 532525626925339 569181840367999 621954236655853 657872128334711 66816...

output:

729347694

result:

ok 1 number(s): "729347694"

Test #30:

score: 0
Accepted
time: 21ms
memory: 3580kb

input:

50000
29 37806871042691 53295608824691 63556535092871 71615064831059 75928605408581 80512985715299 89912665382933 123587240866907 165262167950807 177423784382431 188086168356521 190641612093859 194027984240347 208942534021607 238298573040211 240956123682481 289040113360763 302650185294629 3053320417...

output:

626105189

result:

ok 1 number(s): "626105189"

Test #31:

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

input:

100000
5 67 79 229 647 821 1153 1223 1259 2281 2347 3079 3529 3613 3701 4159 4943 4957 4993 5113 5669 5711 5939 6397 7219 7573 8597 8969 9767 9829 10169 10399 10531 11779 13109 13187 13291 13421 13523 13709 14983 15823 15923 17393 17791 17903 18287 18307 18341 18397 18713 18743 18797 19289 19727 201...

output:

379805271

result:

ok 1 number(s): "379805271"

Test #32:

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

input:

100000
61 5932425241871 8133517188427 9263421467593 12113532535813 29429419231367 30330211105367 43997673852961 45644635683209 59981680884949 62440173745127 65896167526801 88757717737861 91037264332649 111425747321401 122356467562033 125759689524331 134263408107989 142565646022183 144343733499547 14...

output:

884866658

result:

ok 1 number(s): "884866658"

Test #33:

score: 0
Accepted
time: 40ms
memory: 3636kb

input:

100000
31 2312197155193 8558315660761 14096680650323 15828722450371 20687622229927 23107020221717 27275039156837 33179561860121 51733483889459 56621689163471 59547000502183 64959754152119 101932067978329 107078184679757 109459259217947 125453302546519 143599688776343 151562500185289 155300348150707 ...

output:

600850045

result:

ok 1 number(s): "600850045"

Test #34:

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

input:

100000
7 274006741427 1116229401383 5367908786549 12287133720023 13397975891837 15362277871147 20561107982267 27785414519869 35111180971513 42508922728631 53736172850579 56721217020973 61337737662631 67474680085123 76831604051743 81715953276929 97442180321327 118306459647469 123317671015367 12411777...

output:

129918697

result:

ok 1 number(s): "129918697"

Test #35:

score: 0
Accepted
time: 14ms
memory: 3736kb

input:

100000
2 1312286141363 16866290323331 17858778840977 25455017857979 40045058737043 72882541732391 79190612666939 87675247152329 89887856604827 101538664697461 116560471652489 117236311848017 118625301110893 120118252889549 147056821371503 155492609580527 159051312223789 164809824702253 1699424266726...

output:

257843069

result:

ok 1 number(s): "257843069"

Test #36:

score: 0
Accepted
time: 16ms
memory: 3652kb

input:

100000
3 1048091630009 4530201743257 5365975397413 12772470903613 18019342057361 23680221559471 30469438909853 35337046402331 50689804829869 64795411987909 77113725433091 95731032871259 106109412112019 110389263950081 120179977247191 121579569391253 126328400980339 133673909469169 134730922608941 13...

output:

511160817

result:

ok 1 number(s): "511160817"

Test #37:

score: 0
Accepted
time: 69ms
memory: 3800kb

input:

100000
71 1262652077977 3881828051093 7699799600651 19100357922889 22617080352803 24596496526529 34201441581733 54244969348159 60672663729343 70010109402043 77535921694681 82522551987077 93141630386561 98073540660671 101800450744711 107936776731097 111707140005679 119308340144141 119701603891627 122...

output:

965773736

result:

ok 1 number(s): "965773736"

Test #38:

score: 0
Accepted
time: 26ms
memory: 3728kb

input:

100000
23 8945882330509 14969763891997 18014697606641 18419239969789 42718376216891 44993243302573 53560804344461 61967387901337 65305080875339 71694597506657 73490653007777 80782295215117 82610082512809 89022582300623 98786777238679 99322547529097 103389634037941 109559581348661 118695474810307 125...

output:

925825643

result:

ok 1 number(s): "925825643"

Test #39:

score: 0
Accepted
time: 40ms
memory: 3740kb

input:

100000
37 23142023546063 40971338051893 75150913552219 81128560217357 99015214697857 109502862698447 129138279394673 132529789020271 137692616043869 142926889709651 146576364546533 147474955395623 156485297902733 157970499531857 175104401103581 181602362301287 189474868196279 199632906548149 1997097...

output:

316563583

result:

ok 1 number(s): "316563583"

Test #40:

score: 0
Accepted
time: 81ms
memory: 3768kb

input:

100000
89 32970362580901 33533332729439 41395853554631 51477391798961 52563649417471 73081523569489 80073224100671 93546962806699 94891414845949 102325465365107 121728548068177 133274356971331 135081479144627 145182619903729 148244700833161 156375208707719 163539738476449 163871351692109 17202886876...

output:

979322848

result:

ok 1 number(s): "979322848"

Test #41:

score: 0
Accepted
time: 16ms
memory: 3728kb

input:

100000
2 2769124963303 4540826320909 22228644445367 22629696746507 31352452198141 32368479236651 39368966131603 44053931693069 47154837811867 49785107067083 56988938077427 59810582776999 67520554606693 72345232745671 127462944809527 128734482027989 131433546227141 132373823827747 133429631074543 159...

output:

119068402

result:

ok 1 number(s): "119068402"

Test #42:

score: 0
Accepted
time: 78ms
memory: 3748kb

input:

100000
89 65721120011 9257167571677 9727613925971 23574582372949 24635569538137 27565828772927 32328419959417 39508744429027 43724049594133 61609188214411 67643461311817 77491696630169 82919306693021 83142583069961 98167999414649 140110874136031 147057903935027 156531415208999 169025967148757 169076...

output:

366273455

result:

ok 1 number(s): "366273455"

Test #43:

score: 0
Accepted
time: 26ms
memory: 3804kb

input:

100000
19 12245305489939 14915824384931 42061052366149 42880605666307 56620597159573 61447331728001 75706119716543 86368831637327 95628628558831 98388410671087 104892397593551 105399199112213 112175914724063 113415814956517 125449161698747 128362054482001 128756271365209 134274724503641 134638900919...

output:

111547793

result:

ok 1 number(s): "111547793"

Test #44:

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

input:

100000
31 5957549623793 22915266340397 28670644209343 38211304029883 39302297936243 58499998922371 58511119767521 65333546896117 66163646383477 70494548407709 71350379018131 71966161320671 80513527238869 89095131890953 115648908482533 124659669284537 160433307133007 166705891193867 181662753960889 1...

output:

550159869

result:

ok 1 number(s): "550159869"

Test #45:

score: 0
Accepted
time: 65ms
memory: 3796kb

input:

100000
79 6657855874699 9710746248949 16864838075651 19456876741691 50353924515641 70566733999667 85741877468563 116757336077519 122797830452897 127427373044249 145202281699411 147697754952577 149890324111133 154761579886271 157280315823539 168338619253303 175341342476359 176737971174409 18585546453...

output:

989078062

result:

ok 1 number(s): "989078062"

Test #46:

score: 0
Accepted
time: 71ms
memory: 3676kb

input:

100000
97 6930007048801 7972800179489 15664397144723 20814295342117 24914412630061 27228341389787 31252744386113 38634558133697 48283892404081 54344794875313 62807271772813 67205867157263 73388346581191 76773853347379 80747532233527 91798076408069 93405757174661 96033986741821 98941755794393 1139078...

output:

262323197

result:

ok 1 number(s): "262323197"

Test #47:

score: 0
Accepted
time: 33ms
memory: 3748kb

input:

100000
29 1556300523383 7059118712131 7066690730797 12793052020373 22613683371403 25728203893927 30277356728807 43391816016499 53132355001471 57517339411837 78790096116377 79692965099159 87568950293779 98853844131271 106424349053419 107380756792891 125679420113173 135089655470369 157976324046241 159...

output:

966979796

result:

ok 1 number(s): "966979796"

Test #48:

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

input:

100000
29 2701918227707 7905376837447 12817139341939 13338048206047 23187516777001 33268441335293 40836422119123 53183603727971 63610753567421 64789661765183 68420019107149 73690877227963 85137537658541 113774854761049 117201051359233 125081416167551 130161424876157 141055553656943 146536211480753 1...

output:

638501546

result:

ok 1 number(s): "638501546"

Test #49:

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

input:

100000
71 6757640666201 13422759832543 18555732560293 27002827551673 40523384507027 42105284886683 49501505804617 49580762962859 52584462381863 60266444991083 76240876628803 96821261243407 109288483838657 109643156700719 119846956756213 122208968994331 123089520953719 123635990946577 153449450563793...

output:

46374083

result:

ok 1 number(s): "46374083"

Test #50:

score: 0
Accepted
time: 29ms
memory: 3796kb

input:

100000
19 761597257741 4573256604233 15713084268227 22084104499337 23709730347139 31602593848669 35641634365481 36967918689803 44637733315183 47333476655701 66786134879027 69682525665281 74311608989039 90529035743173 103792522924999 109422928087313 124176957723053 131214675076337 147717851217241 168...

output:

458950773

result:

ok 1 number(s): "458950773"

Test #51:

score: 0
Accepted
time: 46ms
memory: 3748kb

input:

100000
53 1232421158929 3974653901159 12299415914749 14636312440751 32683511690437 42002701017353 54949855732019 56479803095473 58790063102203 71206991143489 77763933087103 87516931695581 103330677024941 154490790585359 167003585043403 182653815767363 197632294120103 198276210932407 209923613182873 ...

output:

242273504

result:

ok 1 number(s): "242273504"

Test #52:

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

input:

100000
3 8630714484589 28700837703997 48156735747283 66718819982063 68601243163603 71863879299809 74746310952749 95795091516757 127982395128389 143631209915099 152681266267771 158707840271413 160522997382071 169632776242099 174892542544519 181860646532351 193567963605349 197900803576429 199156600546...

output:

763053477

result:

ok 1 number(s): "763053477"

Test #53:

score: 0
Accepted
time: 58ms
memory: 3804kb

input:

100000
61 1203186568253 8944256649239 14621303235053 19199448189469 19407811886713 40225640549257 40441679626727 40796116699963 50436025981181 52494669212813 55914852061451 61224684890183 61996306400387 64111927448797 72737472210493 76067688354761 78683137561867 84637807015999 109762555385251 118450...

output:

924531455

result:

ok 1 number(s): "924531455"

Test #54:

score: 0
Accepted
time: 59ms
memory: 3736kb

input:

100000
59 5319538865659 24082015381033 29681129050999 30675186536563 36522562618123 46082733902081 48373859652557 54499874911147 55864561873171 57407367667081 66372844996687 71891155987139 77972347902103 90606658908221 97060574395009 100407046643207 101607560650249 121249184982487 123460852649011 14...

output:

914424448

result:

ok 1 number(s): "914424448"

Test #55:

score: 0
Accepted
time: 18ms
memory: 3800kb

input:

100000
17 7704463743001 11972401536923 18114256671373 19792843611811 19894758780367 20612809743067 23186586494707 38951276233711 47104617553229 69521414688793 75326473366013 92595349562143 93147025272583 119905152760157 121063598049257 146614036602899 148294848561551 150963199166629 152813864826577 ...

output:

707319518

result:

ok 1 number(s): "707319518"

Test #56:

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

input:

100000
23 352331490323 691708529507 3014173145821 14239529463557 18556921083697 37651565797327 67336059942493 73374305270281 83929988322163 93055318954343 128045320716311 131389909938691 138696985961273 149817613498307 151993170522299 153035344120739 164820999548407 172287572522173 172462173920341 1...

output:

921853777

result:

ok 1 number(s): "921853777"

Test #57:

score: 0
Accepted
time: 21ms
memory: 3796kb

input:

100000
13 1434574327969 5484368019443 6757338228343 10944456139987 20615356445413 22516678123123 25091372757883 27341191369607 49959088763483 56652005804903 67776634932311 69850277131949 79030456293973 79770285130759 117897058504999 120899492064047 132304039987193 137567474317751 139804164299089 142...

output:

189960003

result:

ok 1 number(s): "189960003"

Test #58:

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

input:

100000
23 900000084381136009 900001050437307271 900001775893846273 900002011458469391 900003880183835177 900006266413307827 900006464698098833 900006518928053599 900006541634802353 900006972943637773 900007290592447361 900007890827757163 900009140584897433 900012030108149177 900012822321620257 90001...

output:

129449711

result:

ok 1 number(s): "129449711"

Test #59:

score: 0
Accepted
time: 20ms
memory: 3740kb

input:

100000
2 990000017606488457 990000112156027703 990000132449235889 990000229835133227 990000835194663983 990001266758257051 990001324253033429 990001597714934443 990001633965545339 990001679821955431 990001830371006633 990001840456645277 990001988382644389 990002125533569821 990002545642614887 990002...

output:

43277125

result:

ok 1 number(s): "43277125"

Test #60:

score: 0
Accepted
time: 32ms
memory: 3780kb

input:

100000
17 999900000379264879 999900000454114547 999900002125616309 999900002660189693 999900002706666053 999900002945848091 999900003360825989 999900003776896843 999900004416873853 999900004643007229 999900005535634163 999900006262674203 999900006377618341 999900006923143427 999900007249141651 99990...

output:

632627310

result:

ok 1 number(s): "632627310"

Test #61:

score: 0
Accepted
time: 20ms
memory: 3744kb

input:

100000
11 999999990000120841 999999990000348787 999999990000394519 999999990000396457 999999990000767683 999999990000793063 999999990000864031 999999990000871583 999999990001049101 999999990001203953 999999990001333579 999999990001624657 999999990001754629 999999990001791557 999999990001805759 99999...

output:

749291068

result:

ok 1 number(s): "749291068"

Test #62:

score: 0
Accepted
time: 14ms
memory: 3748kb

input:

100000
2 999999999000001577 999999999000015373 999999999000020377 999999999000023759 999999999000043963 999999999000079481 999999999000086017 999999999000090133 999999999000090901 999999999000101917 999999999000105197 999999999000114173 999999999000120571 999999999000123239 999999999000124289 999999...

output:

9274702

result:

ok 1 number(s): "9274702"