QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#807813#9864. Coinhxu10TL 1483ms10816kbPython3861b2024-12-10 12:22:542024-12-10 12:23:05

Judging History

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

  • [2024-12-10 12:23:05]
  • 评测
  • 测评结果:TL
  • 用时:1483ms
  • 内存:10816kb
  • [2024-12-10 12:22:54]
  • 提交

answer

import math
from collections import deque 



def main():

    n,k = map(int,input().split())

    
        

    curr = 1
    ans = -1

    while curr <= n:
        b = (curr - 1)//k * k + k
        step = b // k
        if b > n:
            ans = curr + (n - curr)//step * step
            break

        curr += (b - curr)//step * step


        
        front = curr + step
        rear = curr + step * k // (k-1) + 20 

        while front < rear:
            mid = (front + rear)//2
            should = (mid - 1)//k+1 
            actual = mid - curr
            if actual < should:
                front = mid + 1
            else:
                rear = mid 

        ans = curr

        curr = front
        
    print(ans)
 
        
               
    

        


 

        










T = int(input())
t = 1
while t <= T:
    main()
    t += 1


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 15ms
memory: 10600kb

input:

4
6 2
8 3
10000 2
1919810 114514

output:

4
8
8192
1919805

result:

ok 4 number(s): "4 8 8192 1919805"

Test #2:

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

input:

100
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
4 2
4 3
4 4
4 5
4 6
4 7
4 8
4 9
4 10
4 11
5 2
5 3
5 4
5 5
5 6
5 7
5 8
5 9
5 10
5 11
6 2
6 3
6 4
6 5
6 6
6 7
6 8
6 9
6 10
6 11
7 2
7 3
7 4
7 5
7 6
7 7
7 8
7 9
7 10
7 11
8 2
8 3
8 4
8 5
8 6
8 7
8 8
8 9
8 10
8 11
9 ...

output:

2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
4
3
4
4
4
4
4
4
4
4
4
5
4
5
5
5
5
5
5
5
4
5
6
5
6
6
6
6
6
6
4
5
6
7
6
7
7
7
7
7
8
8
8
7
8
7
8
8
8
8
8
8
8
9
8
9
8
9
9
9
8
8
8
9
10
9
10
9
10
10
8
8
11
9
10
11
10
11
10
11

result:

ok 100 numbers

Test #3:

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

input:

100
100 10
100 11
100 12
100 13
100 14
100 15
100 16
100 17
100 18
100 19
101 10
101 11
101 12
101 13
101 14
101 15
101 16
101 17
101 18
101 19
102 10
102 11
102 12
102 13
102 14
102 15
102 16
102 17
102 18
102 19
103 10
103 11
103 12
103 13
103 14
103 15
103 16
103 17
103 18
103 19
104 10
104 11
10...

output:

93
94
92
98
98
94
96
100
96
95
93
94
101
98
98
101
96
100
96
101
93
94
101
98
98
101
96
100
102
101
93
94
101
98
98
101
103
100
102
101
104
104
101
98
98
101
103
100
102
101
104
104
101
98
98
101
103
100
102
101
104
104
101
98
106
101
103
100
102
101
104
104
101
107
106
101
103
107
102
107
104
104
1...

result:

ok 100 numbers

Test #4:

score: 0
Accepted
time: 17ms
memory: 10780kb

input:

100
10000 2
10000 3
10000 4
10000 5
10000 6
10000 7
10000 8
10000 9
10000 10
10000 11
10001 2
10001 3
10001 4
10001 5
10001 6
10001 7
10001 8
10001 9
10001 10
10001 11
10002 2
10002 3
10002 4
10002 5
10002 6
10002 7
10002 8
10002 9
10002 10
10002 11
10003 2
10003 3
10003 4
10003 5
10003 6
10003 7
10...

output:

8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
8192
8091
8719
8279
9885
8980
8933
9756
9938
9526
...

result:

ok 100 numbers

Test #5:

score: 0
Accepted
time: 19ms
memory: 10776kb

input:

100
10000 10
10000 11
10000 12
10000 13
10000 14
10000 15
10000 16
10000 17
10000 18
10000 19
10001 10
10001 11
10001 12
10001 13
10001 14
10001 15
10001 16
10001 17
10001 18
10001 19
10002 10
10002 11
10002 12
10002 13
10002 14
10002 15
10002 16
10002 17
10002 18
10002 19
10003 10
10003 11
10003 12...

output:

9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
9938
9526
9903
9913
9713
9441
9949
9599
9984
9683
...

result:

ok 100 numbers

Test #6:

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

input:

100
100000 100
100000 101
100000 102
100000 103
100000 104
100000 105
100000 106
100000 107
100000 108
100000 109
100001 100
100001 101
100001 102
100001 103
100001 104
100001 105
100001 106
100001 107
100001 108
100001 109
100002 100
100002 101
100002 102
100002 103
100002 104
100002 105
100002 106...

output:

99125
99684
99115
99174
99331
99117
99518
99951
99671
99544
99125
99684
99115
99174
99331
99117
99518
99951
99671
99544
99125
99684
99115
99174
99331
99117
99518
99951
99671
99544
99125
99684
99115
99174
99331
99117
99518
99951
99671
99544
99125
99684
99115
99174
99331
99117
99518
99951
99671
99544
...

result:

ok 100 numbers

Test #7:

score: 0
Accepted
time: 8ms
memory: 10604kb

input:

100
9829300000 1000000000
9829300000 1000000001
9829300000 1000000002
9829300000 1000000003
9829300000 1000000004
9829300000 1000000005
9829300000 1000000006
9829300000 1000000007
9829300000 1000000008
9829300000 1000000009
9829300001 1000000000
9829300001 1000000001
9829300001 1000000002
9829300001...

output:

9829299995
9829299995
9829299997
9829300000
9829299999
9829299991
9829300000
9829299991
9829299999
9829299995
9829299995
9829299995
9829299997
9829300000
9829299999
9829300001
9829300000
9829300001
9829299999
9829299995
9829299995
9829299995
9829299997
9829300000
9829299999
9829300001
9829300000
982...

result:

ok 100 numbers

Test #8:

score: 0
Accepted
time: 1453ms
memory: 10712kb

input:

100
9999381928 1232
9999381928 1233
9999381928 1234
9999381928 1235
9999381928 1236
9999381928 1237
9999381928 1238
9999381928 1239
9999381928 1240
9999381928 1241
9999381929 1232
9999381929 1233
9999381929 1234
9999381929 1235
9999381929 1236
9999381929 1237
9999381929 1238
9999381929 1239
99993819...

output:

9995638846
9993981206
9997382406
9994865205
9994009665
9995914019
9997757681
9993825977
9999146806
9993973586
9995638846
9993981206
9997382406
9994865205
9994009665
9995914019
9997757681
9993825977
9999146806
9993973586
9995638846
9993981206
9997382406
9994865205
9994009665
9995914019
9997757681
999...

result:

ok 100 numbers

Test #9:

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

input:

100
9182736475 2938475612
9182736475 2938475613
9182736475 2938475614
9182736475 2938475615
9182736475 2938475616
9182736475 2938475617
9182736475 2938475618
9182736475 2938475619
9182736475 2938475620
9182736475 2938475621
9182736476 2938475612
9182736476 2938475613
9182736476 2938475614
9182736476...

output:

9182736474
9182736474
9182736473
9182736473
9182736472
9182736473
9182736472
9182736472
9182736475
9182736475
9182736474
9182736474
9182736473
9182736473
9182736476
9182736473
9182736476
9182736476
9182736475
9182736475
9182736474
9182736474
9182736477
9182736477
9182736476
9182736477
9182736476
918...

result:

ok 100 numbers

Test #10:

score: 0
Accepted
time: 12ms
memory: 10656kb

input:

100
1827364563 8192837167
1827364563 8192837168
1827364563 8192837169
1827364563 8192837170
1827364563 8192837171
1827364563 8192837172
1827364563 8192837173
1827364563 8192837174
1827364563 8192837175
1827364563 8192837176
1827364564 8192837167
1827364564 8192837168
1827364564 8192837169
1827364564...

output:

1827364563
1827364563
1827364563
1827364563
1827364563
1827364563
1827364563
1827364563
1827364563
1827364563
1827364564
1827364564
1827364564
1827364564
1827364564
1827364564
1827364564
1827364564
1827364564
1827364564
1827364565
1827364565
1827364565
1827364565
1827364565
1827364565
1827364565
182...

result:

ok 100 numbers

Test #11:

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

input:

100
19283 712
19283 713
19283 714
19283 715
19283 716
19283 717
19283 718
19283 719
19283 720
19283 721
19284 712
19284 713
19284 714
19284 715
19284 716
19284 717
19284 718
19284 719
19284 720
19284 721
19285 712
19285 713
19285 714
19285 715
19285 716
19285 717
19285 718
19285 719
19285 720
19285 ...

output:

19263
19264
19256
19268
19271
19275
19277
19282
19273
19271
19263
19264
19284
19268
19271
19275
19277
19282
19273
19271
19263
19264
19284
19268
19271
19275
19277
19282
19273
19271
19263
19264
19284
19268
19271
19275
19277
19282
19273
19271
19263
19264
19284
19268
19271
19275
19277
19282
19273
19271
...

result:

ok 100 numbers

Test #12:

score: 0
Accepted
time: 12ms
memory: 10720kb

input:

100
931872 2
931872 3
931872 4
931872 5
931872 6
931872 7
931872 8
931872 9
931872 10
931872 11
931873 2
931873 3
931873 4
931873 5
931873 6
931873 7
931873 8
931873 9
931873 10
931873 11
931874 2
931874 3
931874 4
931874 5
931874 6
931874 7
931874 8
931874 9
931874 10
931874 11
931875 2
931875 3
93...

output:

524288
699912
870067
897790
785937
915823
837326
857391
922673
924554
524288
699912
870067
897790
785937
915823
837326
857391
922673
924554
524288
699912
870067
897790
785937
915823
837326
857391
922673
924554
524288
699912
870067
897790
785937
915823
837326
857391
922673
924554
524288
699912
870067...

result:

ok 100 numbers

Test #13:

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

input:

100
8192839182 5
8192839182 6
8192839182 7
8192839182 8
8192839182 9
8192839182 10
8192839182 11
8192839182 12
8192839182 13
8192839182 14
8192839183 5
8192839183 6
8192839183 7
8192839183 8
8192839183 9
8192839183 10
8192839183 11
8192839183 12
8192839183 13
8192839183 14
8192839184 5
8192839184 6
...

output:

6754235438
7152383772
8159686869
7351034658
7446026901
7946836488
7911147037
7780465391
8053838740
8120975993
6754235438
7152383772
8159686869
7351034658
7446026901
7946836488
7911147037
7780465391
8053838740
8120975993
6754235438
7152383772
8159686869
7351034658
7446026901
7946836488
7911147037
778...

result:

ok 100 numbers

Test #14:

score: 0
Accepted
time: 1075ms
memory: 10628kb

input:

1
624316466073 510898

output:

624315891515

result:

ok 1 number(s): "624315891515"

Test #15:

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

input:

1
584168471556 5933376145

output:

584168471473

result:

ok 1 number(s): "584168471473"

Test #16:

score: 0
Accepted
time: 6ms
memory: 10716kb

input:

6
128270069342 39203288979
48854323016 41936279254
81851329804 62917859922
132263312755 36620918503
210754901279 9025776456
272799940258 4312149599

output:

128270069340
48854323016
81851329804
132263312755
210754901259
272799940230

result:

ok 6 numbers

Test #17:

score: 0
Accepted
time: 450ms
memory: 10772kb

input:

8
228218326525 3171
159588493923 957
174286466215 7357
112633236378 536
139590979461 6551
52850080712 8363
54559409113 7430
18770059105 7876

output:

228147707343
159513887158
174274161212
112445395843
139589217186
52845583489
54556556073
18769080829

result:

ok 8 numbers

Test #18:

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

input:

1
1000000000000 90046129

output:

999999998143

result:

ok 1 number(s): "999999998143"

Test #19:

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

input:

100
368234617 7967467575
197242221 7133058061
205192656 2978819397
544446629 9992592362
21433416 844598013
573844806 8950130580
485461784 4593504290
178227277 8703634256
505447507 12114507125
165411729 10593633623
642747355 3772555145
78724833 4016558412
666807167 9343171623
717523306 11618426983
29...

output:

368234617
197242221
205192656
544446629
21433416
573844806
485461784
178227277
505447507
165411729
642747355
78724833
666807167
717523306
298260405
415039765
552243401
28373814
560580346
554998705
597696861
501430556
97127767
518653496
304171090
159601240
288731296
401626316
30602809
90393529
677992...

result:

ok 100 numbers

Test #20:

score: 0
Accepted
time: 9ms
memory: 10768kb

input:

18
106749483762 1642702878
1198003369 1413986589
55662566274 863789044
58072071499 1773788024
29694767026 1477798455
64556691219 509235236
85073838340 1471142191
89551547992 1758604601
23495693868 134893171
73928054938 1604350395
27364989081 1731290477
13088236418 173067848
83457106025 1574045551
27...

output:

106749483731
1198003369
55662566215
58072071478
29694767021
64556691218
85073838305
89551547964
23495693750
73928054914
27364989079
13088236390
83457106012
27213980131
70117749484
28387838325
45818243728
70839559986

result:

ok 18 numbers

Test #21:

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

input:

1
999999983193 3

output:

679432581716

result:

ok 1 number(s): "679432581716"

Test #22:

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

input:

1
999717524751 4

output:

864196756214

result:

ok 1 number(s): "864196756214"

Test #23:

score: 0
Accepted
time: 9ms
memory: 10680kb

input:

1
998377349927 6

output:

982526906933

result:

ok 1 number(s): "982526906933"

Test #24:

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

input:

1
999015056342 9

output:

931489623655

result:

ok 1 number(s): "931489623655"

Test #25:

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

input:

1
998855891070 14

output:

932025860506

result:

ok 1 number(s): "932025860506"

Test #26:

score: 0
Accepted
time: 11ms
memory: 10596kb

input:

1
999529788728 22

output:

960435230160

result:

ok 1 number(s): "960435230160"

Test #27:

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

input:

1
999898972456 35

output:

990134264138

result:

ok 1 number(s): "990134264138"

Test #28:

score: 0
Accepted
time: 17ms
memory: 10672kb

input:

1
998542149122 56

output:

983364418555

result:

ok 1 number(s): "983364418555"

Test #29:

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

input:

1
998541222077 89

output:

998155698276

result:

ok 1 number(s): "998155698276"

Test #30:

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

input:

1
997992762291 142

output:

991654648018

result:

ok 1 number(s): "991654648018"

Test #31:

score: 0
Accepted
time: 23ms
memory: 10600kb

input:

1
999176435560 227

output:

998453963827

result:

ok 1 number(s): "998453963827"

Test #32:

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

input:

1
998884561835 363

output:

998192138616

result:

ok 1 number(s): "998192138616"

Test #33:

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

input:

1
998215515508 580

output:

997248865156

result:

ok 1 number(s): "997248865156"

Test #34:

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

input:

1
999925756958 928

output:

999403198733

result:

ok 1 number(s): "999403198733"

Test #35:

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

input:

1
999885192013 1484

output:

999696262251

result:

ok 1 number(s): "999696262251"

Test #36:

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

input:

1
998862477497 2374

output:

998465726970

result:

ok 1 number(s): "998465726970"

Test #37:

score: 0
Accepted
time: 87ms
memory: 10768kb

input:

1
998558717673 3798

output:

998336398184

result:

ok 1 number(s): "998336398184"

Test #38:

score: 0
Accepted
time: 117ms
memory: 10624kb

input:

1
999983468271 6076

output:

999839529623

result:

ok 1 number(s): "999839529623"

Test #39:

score: 0
Accepted
time: 159ms
memory: 10812kb

input:

1
999176621160 9721

output:

999098173894

result:

ok 1 number(s): "999098173894"

Test #40:

score: 0
Accepted
time: 219ms
memory: 10676kb

input:

1
999856457388 15553

output:

999837160436

result:

ok 1 number(s): "999837160436"

Test #41:

score: 0
Accepted
time: 285ms
memory: 10720kb

input:

1
999103455697 24884

output:

999098562163

result:

ok 1 number(s): "999098562163"

Test #42:

score: 0
Accepted
time: 399ms
memory: 10708kb

input:

1
998525166831 39814

output:

998518514982

result:

ok 1 number(s): "998518514982"

Test #43:

score: 0
Accepted
time: 522ms
memory: 10704kb

input:

1
998735182291 63702

output:

998730875979

result:

ok 1 number(s): "998730875979"

Test #44:

score: 0
Accepted
time: 689ms
memory: 10712kb

input:

1
998001902843 101923

output:

997998589301

result:

ok 1 number(s): "997998589301"

Test #45:

score: 0
Accepted
time: 904ms
memory: 10700kb

input:

1
998182870440 163076

output:

998182088384

result:

ok 1 number(s): "998182088384"

Test #46:

score: 0
Accepted
time: 1081ms
memory: 10652kb

input:

1
998868429067 260921

output:

998867214965

result:

ok 1 number(s): "998867214965"

Test #47:

score: 0
Accepted
time: 1286ms
memory: 10640kb

input:

1
999802506901 417473

output:

999800266787

result:

ok 1 number(s): "999800266787"

Test #48:

score: 0
Accepted
time: 1367ms
memory: 10708kb

input:

1
998595719722 667956

output:

998594956500

result:

ok 1 number(s): "998594956500"

Test #49:

score: 0
Accepted
time: 1102ms
memory: 10672kb

input:

1
999106648184 1068729

output:

999106153009

result:

ok 1 number(s): "999106153009"

Test #50:

score: 0
Accepted
time: 680ms
memory: 10680kb

input:

1
998494204665 1709966

output:

998494201754

result:

ok 1 number(s): "998494201754"

Test #51:

score: 0
Accepted
time: 439ms
memory: 10772kb

input:

1
998045100903 2735945

output:

998044954649

result:

ok 1 number(s): "998044954649"

Test #52:

score: 0
Accepted
time: 282ms
memory: 10760kb

input:

1
998363192174 4377512

output:

998363085406

result:

ok 1 number(s): "998363085406"

Test #53:

score: 0
Accepted
time: 175ms
memory: 10708kb

input:

1
999436386488 7004019

output:

999436306271

result:

ok 1 number(s): "999436306271"

Test #54:

score: 0
Accepted
time: 120ms
memory: 10680kb

input:

1
999898070733 11206430

output:

999898067652

result:

ok 1 number(s): "999898067652"

Test #55:

score: 0
Accepted
time: 79ms
memory: 10648kb

input:

1
998419276190 17930288

output:

998419266980

result:

ok 1 number(s): "998419266980"

Test #56:

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

input:

1
999295122367 28688460

output:

999295090093

result:

ok 1 number(s): "999295090093"

Test #57:

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

input:

1
998641419021 45901536

output:

998641416664

result:

ok 1 number(s): "998641416664"

Test #58:

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

input:

1
998375620851 73442457

output:

998375617980

result:

ok 1 number(s): "998375617980"

Test #59:

score: 0
Accepted
time: 24ms
memory: 10684kb

input:

1
997871763421 117507931

output:

997871762251

result:

ok 1 number(s): "997871762251"

Test #60:

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

input:

1
999215441179 188012689

output:

999215437209

result:

ok 1 number(s): "999215437209"

Test #61:

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

input:

1
999469488033 300820302

output:

999469486755

result:

ok 1 number(s): "999469486755"

Test #62:

score: 0
Accepted
time: 9ms
memory: 10696kb

input:

1
997889989328 481312483

output:

997889988761

result:

ok 1 number(s): "997889988761"

Test #63:

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

input:

1
998448098607 770099972

output:

998448097873

result:

ok 1 number(s): "998448097873"

Test #64:

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

input:

1
998382180664 1232159955

output:

998382180268

result:

ok 1 number(s): "998382180268"

Test #65:

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

input:

1
998600874515 1971455928

output:

998600874193

result:

ok 1 number(s): "998600874193"

Test #66:

score: 0
Accepted
time: 9ms
memory: 10648kb

input:

1
999843908255 3154329484

output:

999843908222

result:

ok 1 number(s): "999843908222"

Test #67:

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

input:

1
998643574772 5046927174

output:

998643574733

result:

ok 1 number(s): "998643574733"

Test #68:

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

input:

1
998100105909 8075083478

output:

998100105847

result:

ok 1 number(s): "998100105847"

Test #69:

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

input:

1
999414359806 12920133564

output:

999414359744

result:

ok 1 number(s): "999414359744"

Test #70:

score: 0
Accepted
time: 7ms
memory: 10776kb

input:

1
999062813643 20672213702

output:

999062813600

result:

ok 1 number(s): "999062813600"

Test #71:

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

input:

1
998353964999 33075541923

output:

998353964979

result:

ok 1 number(s): "998353964979"

Test #72:

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

input:

1
998974078847 52920867076

output:

998974078837

result:

ok 1 number(s): "998974078837"

Test #73:

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

input:

1
999489383292 84673387321

output:

999489383282

result:

ok 1 number(s): "999489383282"

Test #74:

score: 0
Accepted
time: 8ms
memory: 10652kb

input:

1
999409642056 135477419713

output:

999409642054

result:

ok 1 number(s): "999409642054"

Test #75:

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

input:

1
999228484332 216763871540

output:

999228484328

result:

ok 1 number(s): "999228484328"

Test #76:

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

input:

1
999642428510 346822194464

output:

999642428509

result:

ok 1 number(s): "999642428509"

Test #77:

score: 0
Accepted
time: 9ms
memory: 10772kb

input:

1
998955211876 554915511142

output:

998955211876

result:

ok 1 number(s): "998955211876"

Test #78:

score: 0
Accepted
time: 8ms
memory: 10772kb

input:

1
998072297804 887864817827

output:

998072297803

result:

ok 1 number(s): "998072297803"

Test #79:

score: 0
Accepted
time: 35ms
memory: 10672kb

input:

9
157215792175 106
78320743656 47
99173366595 43
186725849411 134
147562051450 4
108057913872 60
154505037107 28
9397437270 175
45637286038 82

output:

156160951962
77959919190
98184918667
185390264806
115356341908
106666090335
149958636933
9374638605
45502405645

result:

ok 9 numbers

Test #80:

score: 0
Accepted
time: 1483ms
memory: 10592kb

input:

11
24888356652 41676
77084765730 31052
29035458486 18498
111845326262 12034
46806653623 39507
50002744739 5748
85138903365 24943
2416834054 44845
179977385119 3067
168481623886 48211
162671320114 10743

output:

24887969756
77084744612
29034857586
111843622577
46806471208
49998695588
85135663568
2416831287
179961494788
168480742315
162665101673

result:

ok 11 numbers

Test #81:

score: -100
Time Limit Exceeded

input:

100
10000000000 100001
10000000000 99999
10000000000 100002
10000000000 99998
10000000000 100003
10000000000 99997
10000000000 100004
10000000000 99996
10000000000 100005
10000000000 99995
10000000000 100006
10000000000 99994
10000000000 100007
10000000000 99993
10000000000 100008
10000000000 99992
...

output:

9999925360
9999959090
9999917180
9999959182
9999958830
9999960831
9999901326
9999955504
9999922336
9999999774
9999989396
9999992518
9999982255
9999909796
9999942734
9999935824
9999983329
9999943902

result: