QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#765688#1339. Consistent Tradingucup-team173#AC ✓102ms17256kbC++201.2kb2024-11-20 15:00:422024-11-20 15:00:45

Judging History

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

  • [2024-11-20 15:00:45]
  • 评测
  • 测评结果:AC
  • 用时:102ms
  • 内存:17256kb
  • [2024-11-20 15:00:42]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using i128 = __int128_t;

constexpr ll P = ll(1e18) + 9;

ll qpow(ll a, ll b) {
    ll res = 1;
    while(b) {
        if(b & 1) res = (i128)res * a % P;
        a = (i128)a * a % P, b >>= 1;
    }
    return res;
}

void solve() {
    int n, m;
    cin >> n >> m;
    vector G(n + 1, vector<pair<int, ll>>());
    for(int i = 1; i <= m; i++) {
        int a, x, b;
        cin >> a >> b >> x;
        G[a].push_back({b, x});
        G[b].push_back({a, qpow(x, P - 2)});
    }
    vector<int> vis(n + 1);
    vector<ll> val(n + 1, -1);
    int flg = 1;
    auto dfs = [&](auto self, int x) -> void {
        vis[x] = 1;
        for(auto [y, w] : G[x]) {
            if(!vis[y]) {
                val[y] = (i128)val[x] * w % P;
                self(self, y);
            } else if(val[y] != (i128)val[x] * w % P) {
                flg = 0;
            }
        }
    };
    for(int i = 1; i <= n; i++) if(!vis[i]) {
        val[i] = 1;
        dfs(dfs, i);
    }
    cout << (flg ? "Yes" : "No") << '\n';
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t = 1;
    // cin >> t;
    while(t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4 4
1 2 2
2 3 2
3 4 2
4 2 3

output:

No

result:

ok "No"

Test #2:

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

input:

4 3
1 2 7
2 3 5
4 1 2

output:

Yes

result:

ok "Yes"

Test #3:

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

input:

4 4
1 2 101
2 3 99
1 4 100
4 3 100

output:

No

result:

ok "No"

Test #4:

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

input:

5 6
3 1 4
2 3 4
5 4 15
2 1 16
2 4 20
5 3 3

output:

Yes

result:

ok "Yes"

Test #5:

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

input:

10 17
6 5 265734983
4 9 631933499
1 2 450290420
7 1 577953100
3 8 92694360
10 3 761646389
3 6 392253210
10 1 449374360
6 4 851489585
6 7 63621701
3 1 576785719
3 2 634083860
10 9 429292904
5 2 199416975
10 5 839205223
7 9 596491153
3 5 652832022

output:

No

result:

ok "No"

Test #6:

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

input:

4 2
1 3 64273202
2 4 384367629

output:

Yes

result:

ok "Yes"

Test #7:

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

input:

5 2
5 3 497476572
5 4 364850118

output:

Yes

result:

ok "Yes"

Test #8:

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

input:

7 1
5 4 258406601

output:

Yes

result:

ok "Yes"

Test #9:

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

input:

4 3
4 3 504856579
1 4 646945713
2 3 388357231

output:

Yes

result:

ok "Yes"

Test #10:

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

input:

7 21
2 6 663227492
7 4 461354276
3 4 28152109
6 4 358823726
5 2 619487277
3 7 260147635
3 1 877405198
5 1 955891101
1 4 957499076
3 2 384665589
7 6 368531672
7 1 914427926
1 2 97380293
2 7 787748249
6 3 293843142
4 5 962318607
7 5 44905554
5 6 510079867
1 6 325095627
3 5 347330348
2 4 453400205

output:

No

result:

ok "No"

Test #11:

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

input:

8 13
7 8 522627804
7 2 400792198
6 7 220572477
8 6 772420713
4 5 949106732
1 2 867088911
6 3 850851737
1 4 541599109
4 6 310148807
2 6 481974581
1 6 792195677
4 2 311938108
7 1 460640026

output:

No

result:

ok "No"

Test #12:

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

input:

7 17
5 6 278219751
1 2 888194392
7 5 422277480
4 1 438560464
4 6 86173934
6 7 738154829
2 5 149378290
7 2 781306443
5 3 290126418
7 1 910494332
1 5 432352620
2 3 69931343
1 6 257768620
4 2 296685964
3 4 111244605
6 3 65247518
4 5 854386607

output:

No

result:

ok "No"

Test #13:

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

input:

2 1
1 2 11120644

output:

Yes

result:

ok "Yes"

Test #14:

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

input:

9 30
1 9 767960951
4 1 843961520
4 5 753611695
7 8 994435066
2 5 996986937
6 7 979505444
7 1 797888527
8 5 132536139
3 2 190075945
4 8 781527916
9 8 678009694
5 6 366110865
4 3 902969662
2 1 924897880
3 9 249564963
2 6 22491710
6 4 555261264
3 8 918118198
6 3 861966090
5 3 422916723
2 8 212080020
1 ...

output:

No

result:

ok "No"

Test #15:

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

input:

69862 16243
61420 64532 280460887
32912 33645 212682531
22783 31406 94042606
47240 23816 532005326
56757 36042 794651906
38378 65261 5084078
15179 17842 554767388
24796 14480 692889976
22928 18909 780109469
13637 12354 412459465
34232 2209 724813520
9922 60865 713394801
14332 38843 669586503
53206 6...

output:

Yes

result:

ok "Yes"

Test #16:

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

input:

827 21822
18 821 642462789
513 112 311836307
240 658 73121766
16 246 579367910
208 423 117505817
179 530 851348979
488 485 678468520
779 486 453668275
801 647 771631421
113 50 354211008
250 522 133629880
497 421 707140103
228 643 267692035
640 208 703367050
324 429 541669576
801 172 545505111
530 34...

output:

No

result:

ok "No"

Test #17:

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

input:

21170 14190
12190 1919 829256837
13172 14442 754634128
13158 17979 219895002
7962 3318 745811773
2000 12434 619598111
4130 12688 716508065
286 15300 667007847
20755 19573 326606412
17386 16179 432664111
17037 20764 282071877
4295 4361 897036638
6700 7818 59183942
17772 2272 862602730
14386 1303 3994...

output:

No

result:

ok "No"

Test #18:

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

input:

9663 84196
8297 1879 292786372
9215 397 652140130
7444 9475 230784857
3715 5438 451941544
940 2271 372156459
2571 7053 731142133
450 5554 150223192
9330 4598 320338112
3889 5406 767450300
7115 2515 753332496
1397 4858 787930543
4022 5066 1956218
5284 4664 835728412
9339 1409 756955717
2837 7517 3945...

output:

No

result:

ok "No"

Test #19:

score: 0
Accepted
time: 38ms
memory: 7128kb

input:

24363 46728
11279 14632 838193751
22537 8614 985775026
2002 239 575454959
14348 19836 897828533
16269 16405 30369733
18692 20536 172894860
21749 8322 804563413
6958 886 582454166
12061 17305 480341825
23654 3377 593320639
19955 801 861707475
11628 4705 905166352
16306 23449 342264020
14163 6023 7103...

output:

No

result:

ok "No"

Test #20:

score: 0
Accepted
time: 99ms
memory: 12380kb

input:

75774 97925
27616 29383 814253970
46864 71571 495830926
6229 28188 834105682
53892 48713 492017500
61104 61677 266373726
47725 70995 789552512
72121 15109 715629932
73020 68371 835662806
9441 6566 664939615
5044 45133 295097395
12319 47956 692063837
45460 56387 949953406
67952 9234 415898495
74535 2...

output:

No

result:

ok "No"

Test #21:

score: 0
Accepted
time: 38ms
memory: 6596kb

input:

3257 54391
1478 1881 405181854
2268 2418 266963650
1942 3061 811310494
1309 2846 602605161
1285 1372 880180026
1883 607 269944530
2204 2370 125240324
3105 911 933126555
317 2218 89577732
2058 582 92554043
2052 1675 533667739
1150 275 786833047
2918 2843 621676173
886 2576 647436671
1732 1920 4449942...

output:

No

result:

ok "No"

Test #22:

score: 0
Accepted
time: 94ms
memory: 12924kb

input:

93836 96085
26437 6661 172197286
72936 28639 8334549
67103 81135 845010863
46695 90447 845089693
15590 82835 672972514
28797 37047 588092133
52927 19300 71955055
37181 22230 351020581
53822 49645 790537805
72151 88523 917547217
89100 14757 357043887
88802 63473 520258996
34870 60259 114665520
29198 ...

output:

No

result:

ok "No"

Test #23:

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

input:

59423 8731
48994 48904 532953843
29413 16950 230007051
45437 49477 783665121
58732 15777 598315126
51498 1669 127041842
3281 50778 658262445
4446 33237 175452201
5693 14091 6930658
17351 6734 835152427
54859 57408 528373972
7167 27120 979438685
29434 21874 796366418
26137 11725 186239191
19239 36979...

output:

Yes

result:

ok "Yes"

Test #24:

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

input:

1669 44970
1289 881 580615741
199 305 544628212
124 987 889744111
651 5 650335708
1016 723 372958146
183 1315 485567780
1322 1305 782416327
262 1409 793841827
980 489 680565826
37 615 662957321
1378 1643 481203237
1029 1167 816371526
995 372 399184355
39 1462 310714994
98 1303 623837314
537 59 79809...

output:

No

result:

ok "No"

Test #25:

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

input:

4 4
1 2 999999996
2 3 999999999
1 4 999999997
4 3 999999998

output:

No

result:

ok "No"

Test #26:

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

input:

4 4
1 2 999999999
2 3 999999999
1 4 999999999
4 3 1000000000

output:

No

result:

ok "No"

Test #27:

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

input:

4 4
1 2 1000000000
2 3 1000000000
1 4 999999999
4 3 1000000000

output:

No

result:

ok "No"

Test #28:

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

input:

3 3
1 2 1
2 3 1
3 1 1

output:

Yes

result:

ok "Yes"

Test #29:

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

input:

92816 621
58624 86675 142979215
9703 77323 626699040
91253 88207 593363841
65249 72303 7134145
31555 91846 644098701
89255 73558 112862491
36790 86148 14774701
57934 75241 222857121
54408 79027 37572766
78990 84528 442171327
80276 64041 9229135
88464 80293 305432254
70572 84179 11271261
84310 34111 ...

output:

No

result:

ok "No"

Test #30:

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

input:

99321 643
31986 24126 322460281
82495 40732 521810477
59778 75515 128630745
67522 12222 41618110
58374 53471 12744772
89201 84203 12879571
66129 56509 348782121
70365 61402 421097171
77662 79994 13147042
63200 78279 345121833
77609 79787 82945314
77661 74286 47519617
64659 33932 570393280
70089 5410...

output:

No

result:

ok "No"

Test #31:

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

input:

90866 810
14371 74932 111353225
73343 86830 682971385
87721 90157 425229746
83717 85379 198875041
80444 73822 224304634
24833 60009 371318176
78171 65898 14379201
82012 59855 586622518
86098 87484 116823277
18479 83515 30991507
82415 25073 350272861
9578 783 39371061
68830 53515 200177251
61036 6091...

output:

No

result:

ok "No"

Test #32:

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

input:

59 59
42 11 734924456
4 35 171062992
12 37 847960720
24 57 844112224
40 21 972870187
1 38 414966572
21 26 375727810
14 53 692235042
32 55 111259986
55 17 937761769
16 41 135830699
54 28 199079481
33 8 86210451
46 4 12967280
13 33 179815437
48 29 620848643
57 40 687794491
45 25 896416693
15 45 184793...

output:

No

result:

ok "No"

Test #33:

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

input:

58 58
57 3 722760617
32 36 171264773
13 31 44730833
1 40 87130412
42 58 3417203
55 5 901886978
8 57 499450454
22 55 217234039
30 47 389418138
49 12 927219126
39 18 167799364
21 25 680190589
47 54 807732343
9 52 995485488
46 11 332110788
20 49 285003220
4 35 204076597
53 50 279295478
3 19 263818390
2...

output:

No

result:

ok "No"

Test #34:

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

input:

90 90
57 58 941826818
72 40 195753399
22 35 806912742
66 36 139491775
12 65 387857396
67 1 534587223
46 29 487399977
7 87 681269230
48 59 36137095
59 24 104070147
30 2 869104973
8 88 777713506
78 55 582973113
21 89 339831138
42 83 118946096
79 54 526661610
40 9 259677691
83 25 96289195
10 17 8271529...

output:

No

result:

ok "No"

Test #35:

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

input:

76 76
13 67 966109622
38 57 511467548
60 43 576483950
74 51 232074202
30 21 520711281
40 56 702375777
57 39 609917523
25 64 437093256
28 70 660948040
66 23 144408913
18 62 664295839
43 32 680521118
3 74 513014259
47 20 64903930
76 71 389797020
55 41 755060958
8 22 177689574
69 50 642037154
42 13 839...

output:

No

result:

ok "No"

Test #36:

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

input:

87 87
79 59 492248736
29 77 268859576
57 75 1746299
48 38 538290887
16 53 32693878
73 47 715536633
23 14 306292272
77 31 578795670
55 29 423782239
66 56 77807522
84 86 267321578
26 49 385227756
9 35 283105009
31 50 762005601
38 9 985921669
32 68 197984112
22 79 644848781
83 18 82035691
1 30 60300880...

output:

No

result:

ok "No"

Test #37:

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

input:

90 90
42 1 168840500
20 72 98256048
72 71 826924202
23 32 388345772
82 63 916254148
58 27 960737025
18 31 507379474
39 55 836778183
33 26 983377809
31 88 936952115
80 30 360528520
5 12 71250097
13 80 319898757
88 28 137801929
28 24 407040680
44 15 540746942
62 18 771992445
15 70 460469210
49 79 5036...

output:

No

result:

ok "No"

Test #38:

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

input:

50 50
27 26 194828123
14 25 104316105
3 18 519246857
1 8 261364210
23 39 176385936
24 21 349844488
42 15 347632284
48 40 481793993
19 11 401666686
36 49 229747996
37 23 613045314
6 28 187073537
49 24 11455724
11 14 739809024
33 44 585557240
16 43 355312509
43 30 131431846
17 19 251602733
35 50 63639...

output:

No

result:

ok "No"

Test #39:

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

input:

95 95
49 75 456417824
27 49 611789516
29 91 731424411
68 43 626494606
75 8 162416612
9 58 574453
32 3 74789564
16 2 443436024
51 70 787759076
92 47 439843646
1 19 329952793
71 35 674875376
55 23 905893786
18 86 120786196
76 38 233018898
36 18 589561633
43 81 950103485
50 55 168132146
44 93 852597559...

output:

No

result:

ok "No"

Test #40:

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

input:

70 70
58 52 893000376
15 47 371864567
38 64 231332246
28 22 334361720
33 28 420856432
44 34 696563994
50 56 738590169
5 48 341893937
9 27 955420714
31 66 13328786
40 1 536150205
14 31 966044554
53 26 936001269
39 54 258274477
12 5 143476100
59 33 958647210
24 35 419007357
69 41 469877191
10 2 257884...

output:

No

result:

ok "No"

Test #41:

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

input:

85 85
76 55 626156396
49 68 31227489
18 13 662783538
45 40 404470486
39 54 888049015
27 23 885800414
78 62 21301364
85 69 817859765
62 25 264196898
5 70 459600799
71 37 364644823
7 47 601602046
77 71 422289271
23 10 771781195
10 81 859729070
55 67 934680536
17 82 977746260
63 8 487993716
79 75 72890...

output:

No

result:

ok "No"

Test #42:

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

input:

65 65
40 42 134507315
56 17 494985473
21 29 289192069
60 36 438451192
54 24 163939579
52 64 262941358
50 30 221498032
65 63 442104917
41 39 917151997
13 18 220426500
51 48 18645720
64 1 576744869
34 16 46232485
9 57 858688887
22 53 736158678
62 9 706516780
43 26 25498700
33 58 26203374
14 54 8594228...

output:

No

result:

ok "No"

Test #43:

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

input:

71 71
9 68 691022900
10 27 396205475
39 19 991146569
61 43 107751445
60 54 870628323
56 64 915793533
51 37 572171146
64 36 349072715
31 23 332865941
28 70 930341607
20 33 510680058
1 38 363697084
32 47 285398812
44 21 551817592
57 24 906556956
62 17 729871485
40 15 13850622
52 16 883114775
26 39 330...

output:

No

result:

ok "No"

Test #44:

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

input:

76 76
57 18 353998981
18 9 658683093
45 28 65402770
12 76 693651599
10 65 373843948
3 15 320571241
19 17 374370177
48 52 664989061
52 59 233727558
60 5 908959032
12 48 305345099
43 51 88836659
49 7 20375327
29 2 211774920
36 32 140981142
74 70 834691325
34 50 46775860
73 34 80219389
58 62 893474594
...

output:

No

result:

ok "No"

Test #45:

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

input:

62 62
60 5 938153507
48 60 284222348
8 33 760354302
9 7 61920112
5 22 144697494
15 13 140869729
35 46 945714055
29 55 96032840
24 11 557155842
58 10 239646787
12 6 54011206
22 47 574393410
16 52 405877478
21 30 356927831
51 54 538671233
62 20 297784453
27 2 295269547
1 28 301009140
42 1 412514838
44...

output:

No

result:

ok "No"

Test #46:

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

input:

62 62
53 2 46115500
13 44 605918890
60 23 506746254
19 33 944164035
47 16 655723636
49 21 661550730
1 19 868751367
40 22 451305077
41 47 730580033
39 25 417082759
55 43 560348410
6 1 675326992
44 36 731720822
28 51 567927789
22 26 242014969
21 45 626204773
58 52 950263298
12 61 273288501
23 54 47569...

output:

No

result:

ok "No"

Test #47:

score: 0
Accepted
time: 5ms
memory: 6336kb

input:

80437 3978
35675 38813 4
24183 39469 256
19168 31068 4
44593 41996 2
50466 51083 2
7111 49257 128
42444 47361 64
74931 22409 2
66609 63665 16
55436 60914 32
30316 23586 16
32909 18186 8
58999 7208 8
13273 48497 16
32668 12131 64
10405 43005 128
34964 74623 4
11266 10709 2
75821 26064 4
54125 39725 2...

output:

Yes

result:

ok "Yes"

Test #48:

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

input:

57998 12749
40593 53567 1296
39158 13652 36
16731 20569 6
50986 26053 36
35508 43413 10077696
42480 9593 10077696
25612 8205 36
16846 44689 1296
30461 46796 7776
15297 40391 216
49373 42485 1296
45784 29109 7776
17991 29264 216
7918 52243 1296
15362 10089 10077696
47399 30774 1679616
41431 12697 167...

output:

Yes

result:

ok "Yes"

Test #49:

score: 0
Accepted
time: 39ms
memory: 8040kb

input:

73634 44192
36369 66120 262144
24363 13106 512
50687 48522 64
57886 61765 2097152
51379 6684 4096
26114 26703 8
29745 7249 8
31371 53549 8
34715 47333 2097152
47703 59652 64
17992 65120 32768
41193 5079 4096
36501 39336 16777216
49356 64991 8
68897 52582 134217728
61402 18481 4096
24418 44723 209715...

output:

Yes

result:

ok "Yes"

Test #50:

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

input:

83681 6014
34011 76484 100000000
83194 32199 100000
158 48676 100000
59510 36140 10
47489 21626 10
68075 28381 100
30263 4480 100000
62888 77989 100
19671 48440 100000000
23773 56594 1000000000
53730 57207 10000000
72709 75120 100000000
38338 7319 10
34113 80323 10
97 30173 10
10878 16386 100000
141...

output:

Yes

result:

ok "Yes"

Test #51:

score: 0
Accepted
time: 67ms
memory: 10188kb

input:

99841 69443
10536 66148 3125
5881 68378 625
3243 34972 78125
6730 53230 390625
51505 23789 3125
61437 1811 125
56096 67723 3125
82471 66528 15625
33522 90595 625
3906 64721 5
26291 4520 125
21028 93775 390625
57329 75885 625
91185 71082 78125
34021 735 125
91033 55550 78125
95948 60647 5
83677 95715...

output:

Yes

result:

ok "Yes"

Test #52:

score: 0
Accepted
time: 72ms
memory: 9424kb

input:

52032 81906
34361 29797 4
51771 11046 1024
43489 35063 4
20777 50052 16384
1105 36707 64
47402 33300 4
41653 43527 64
7155 4061 16
41074 7527 64
46486 38779 16
9558 39783 262144
44528 15577 1024
45371 14760 4
939 6843 16384
47021 22875 16384
45324 11222 16
9931 9551 262144
40420 7867 4
3746 7604 102...

output:

Yes

result:

ok "Yes"

Test #53:

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

input:

84545 66452
64482 22473 256
45422 78047 2
65038 7726 512
25645 14038 128
3320 51532 512
24745 60760 32
5276 40145 16
23508 18792 128
83681 46002 16
12567 61823 64
79288 25773 4
8146 25253 32
3999 17795 2
11531 12802 32
38105 19328 16
45323 165 16
81733 18 512
73785 68243 512
70998 27856 8
58351 6975...

output:

Yes

result:

ok "Yes"

Test #54:

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

input:

95284 12151
19538 42416 2187
50499 58575 81
65938 54961 27
7508 85288 19683
83231 82309 19683
51477 25231 729
44476 49320 2187
75694 48997 243
6692 43924 27
39493 3207 243
1275 83062 19683
6847 90032 6561
71156 59719 729
56469 10576 729
486 15763 19683
22945 93874 81
28996 12973 6561
26153 93968 81
...

output:

Yes

result:

ok "Yes"

Test #55:

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

input:

87882 58606
43955 20541 134217728
33499 75042 134217728
80147 64426 2097152
35188 29060 64
60135 35918 64
34642 77540 262144
43553 17343 134217728
55138 87709 134217728
20924 16693 134217728
1540 68428 8
86916 7209 32768
41948 16575 16777216
7483 6313 16777216
19178 26622 2097152
48055 48988 32768
4...

output:

Yes

result:

ok "Yes"

Test #56:

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

input:

55968 29261
48535 37181 10000
23691 5745 10000
6159 9 1000
22430 22323 10000
32676 33330 100
43328 7859 1000
47306 2377 1000000
4532 26591 10000000
304 27057 10000000
41340 14772 10
53399 34240 100000000
30850 30624 10000000
51855 8311 100000
23780 20980 10
32846 52520 1000000000
42016 31306 100000
...

output:

Yes

result:

ok "Yes"

Test #57:

score: 0
Accepted
time: 85ms
memory: 15300kb

input:

99921 82960
56086 35222 1088
51673 7949 320
10248 34571 543340224
68425 51548 852418080
56104 18597 738931350
82930 28981 2932
43979 48522 597520000
70367 97336 826483720
36047 34145 57870720
32317 59079 987157854
74025 91076 900201280
71398 84305 907955883
70514 8378 1837404
73765 23238 105168024
3...

output:

Yes

result:

ok "Yes"

Test #58:

score: 0
Accepted
time: 34ms
memory: 10424kb

input:

99955 35896
86228 95544 1962
81241 58831 722710800
56643 18823 590768640
24775 50348 69200
55746 78614 3110400
61546 62453 541157760
23289 28403 580879860
87924 52444 1608
40722 36776 203112
49174 20202 2796240
858 73370 669251136
42706 53187 750720000
72534 56944 9447840
36891 26268 578528820
94705...

output:

Yes

result:

ok "Yes"

Test #59:

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

input:

99931 6476
62307 83325 753602400
78808 98377 922143600
98031 19792 225907200
42614 42933 886540864
76459 7235 1733940
66902 95227 559815696
63954 80880 666005328
582 73740 897437520
25466 31038 321096960
13907 6408 665148042
86710 10291 640888560
55844 85754 174509131
9179 49731 973728000
52889 5084...

output:

Yes

result:

ok "Yes"

Test #60:

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

input:

99950 7006
16229 48247 609640668
2356 57017 774385650
28294 63873 504221088
16847 69959 729906800
19007 76638 709651944
50281 37385 544199400
35032 80534 803275920
77955 94517 908024832
63510 64031 601413384
2126 37620 6054300
22394 21629 914638920
46724 63045 645425280
54905 42153 663616800
23007 8...

output:

Yes

result:

ok "Yes"

Test #61:

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

input:

99987 67138
27484 32631 336139804
96936 59194 333596340
6564 32733 17681490
26379 8320 375070150
17172 50608 4656960
77531 8374 209701800
25874 21596 1
53077 1036 531536
38439 68299 270362400
51513 11242 34300
19010 40470 1
16510 25124 27954234
44601 36410 154680948
11949 1760 456967
47736 63744 603...

output:

Yes

result:

ok "Yes"

Test #62:

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

input:

99977 49316
56559 75600 157842
63054 97932 2222850
39756 29557 710397165
54484 24245 868791264
12952 18295 394442592
14239 62945 747971224
63343 57502 638253000
62698 45943 780103480
36702 4288 986873664
86285 36 1
76333 1952 822577140
28320 41267 515264055
60701 5266 28
38348 10665 68180800
79080 6...

output:

Yes

result:

ok "Yes"

Test #63:

score: 0
Accepted
time: 63ms
memory: 13852kb

input:

99929 71256
42110 3455 194745600
14589 39023 759758400
53116 22364 124416
2708 44115 17217720
47012 48570 6443
42387 28019 2461536
78971 32367 28705425
23661 84442 14820300
92905 35516 16463160
95553 20594 29516850
26419 48953 579390
81052 18754 275296320
82961 49975 268047500
91851 72693 1
74308 14...

output:

Yes

result:

ok "Yes"

Test #64:

score: 0
Accepted
time: 82ms
memory: 14700kb

input:

99991 79018
49566 88155 391872000
82125 43840 829848
19372 93218 71082144
94597 42710 159144
80026 79221 56365632
58164 32562 1251450
14801 56256 168989652
98571 48075 68600
31801 24561 30960
96863 54172 90300
73922 21778 985777000
56347 79638 968640840
49972 71695 3375750
57511 19031 811175904
8366...

output:

Yes

result:

ok "Yes"

Test #65:

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

input:

99904 25294
72726 39623 641771676
49896 42523 662835780
40025 15649 534851352
93960 5954 535550400
63262 57437 173399760
79374 24036 548752086
21560 16907 20580
29280 24790 254056896
63713 30595 158489428
29283 40158 990446592
60040 54372 687529856
69063 8690 575319240
23229 83928 150067536
71261 26...

output:

Yes

result:

ok "Yes"

Test #66:

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

input:

99998 55226
4797 5465 1
43626 13860 116984175
70119 45659 983549952
79837 5538 990451000
90965 58135 132696576
23538 26740 730625280
16837 66729 21048
47221 82019 17360
27577 26459 437219328
81807 6852 2633904
27424 7303 409
14686 36428 536909538
81587 36313 125316
1341 1346 512877828
51263 44958 33...

output:

Yes

result:

ok "Yes"

Test #67:

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

input:

99993 33916
99321 5059 999953058
19089 73128 999953058
62151 39780 999953058
26669 43948 999953058
46763 85150 999953058
9735 24807 999953058
61191 83383 999953058
69439 65593 999953058
19693 52844 999953058
23204 97746 999953058
14145 60244 999953058
62891 1776 999953058
85307 55695 999953058
4167 ...

output:

No

result:

ok "No"

Test #68:

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

input:

99997 36294
38402 43620 999927695
38295 94944 999927695
15090 16467 999927695
6017 47864 999927695
41349 82094 999927695
23071 6633 999927695
3210 70556 999927695
41528 43276 999927695
36420 91036 999927695
23929 85328 999927695
69908 32589 999927695
90630 39309 999927695
11543 52840 999927695
91236...

output:

No

result:

ok "No"

Test #69:

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

input:

99988 31784
98789 34461 999954292
55376 19998 999954292
79576 53284 999954292
5363 28339 999954292
2022 83511 999954292
76625 34680 999954292
17392 54703 999954292
34622 77129 999954292
87505 50650 999954292
53923 33774 999954292
14365 97482 999954292
82311 13013 999954292
58284 59969 999954292
8783...

output:

No

result:

ok "No"

Test #70:

score: 0
Accepted
time: 83ms
memory: 13044kb

input:

99941 99980
36255 5892 1
74172 50150 1
51940 5931 1
89395 21719 1
51848 75473 1
51006 18172 1
21795 56513 1
94101 45381 1
97007 81228 1
91409 92927 1
31248 77943 1
87065 11889 1
33678 53746 1
21251 41706 1
9232 10278 1
40152 89173 1
72915 80448 1
84685 98086 1
61804 65865 1
35986 72156 1
76913 36336...

output:

Yes

result:

ok "Yes"

Test #71:

score: 0
Accepted
time: 99ms
memory: 13040kb

input:

99959 99925
26588 66147 1
94494 28780 1
64625 62391 1
38447 39673 1
25006 44614 1
80452 4618 1
2541 76347 1
41128 84844 1
38829 75041 1
87377 3935 1
47733 31640 1
51319 97260 1
49295 78244 1
59613 82621 1
47382 23389 1
94613 97888 1
57938 5447 1
24770 18759 1
15360 61482 1
98191 90731 1
31462 98922 ...

output:

Yes

result:

ok "Yes"

Test #72:

score: 0
Accepted
time: 97ms
memory: 13048kb

input:

99999 99933
96608 85505 1
43823 23293 1
20447 18961 1
91758 14028 1
51701 14399 1
6983 74815 1
59578 91294 1
94387 30017 1
44074 89577 1
29588 77370 1
48330 27853 1
39780 84404 1
30891 32561 1
49642 52266 1
54187 82957 1
6510 3823 1
62401 76081 1
73935 48068 1
54152 32216 1
65126 85723 1
30643 76364...

output:

Yes

result:

ok "Yes"

Test #73:

score: 0
Accepted
time: 60ms
memory: 10800kb

input:

99244 99985
6928 4755 4
45742 12698 512
94686 4755 512
85881 4755 8192
83891 80240 4
13891 59134 2
59519 49172 131072
83891 80240 4
85881 4755 8192
43226 23723 8
13891 94686 2048
8311 23723 16384
32453 1325 1024
13891 49172 524288
88430 45742 32
59424 4755 1024
94686 61631 2048
77730 52962 65536
138...

output:

Yes

result:

ok "Yes"

Test #74:

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

input:

99296 99963
70831 15689 1
14441 39014 1
70831 87349 1
50761 65854 1
46024 87349 1
38900 46024 1
14441 38900 1
54303 65048 1
86835 54303 1
14441 70831 1
70831 63390 1
56121 63390 1
33972 70831 1
94786 45808 1
31938 24957 1
15689 65048 1
38500 87349 1
83945 39014 1
43286 23809 1
82575 83945 1
24076 23...

output:

Yes

result:

ok "Yes"

Test #75:

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

input:

99219 99919
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
39483 5673 353
394...

output:

No

result:

ok "No"

Test #76:

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

input:

431 92665
108 35 625
395 127 5
158 116 1
216 263 125
153 3 3125
255 83 125
192 135 125
426 109 125
39 3 5
375 314 25
11 62 25
142 210 1
355 114 5
173 144 3125
245 311 1
315 120 25
126 426 1
234 404 1
2 42 3125
270 361 5
367 7 125
189 162 625
147 241 1
35 294 125
78 203 1
118 279 625
367 156 15625
10...

output:

Yes

result:

ok "Yes"

Test #77:

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

input:

417 86736
187 158 343
326 27 49
342 270 1
10 138 7
312 234 49
245 313 7
346 216 7
400 10 2401
42 99 7
190 43 1
18 345 7
176 211 7
21 42 1
150 317 343
47 357 7
341 199 2401
416 283 343
379 289 7
136 387 2401
190 164 49
383 158 343
326 145 16807
203 258 1
413 11 1
374 258 1
166 395 49
285 109 343
122 ...

output:

Yes

result:

ok "Yes"

Test #78:

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

input:

421 88410
168 173 128
306 189 1
142 301 2
291 399 2
289 215 2
95 21 16
39 239 4
416 203 2
62 280 16
58 293 4
331 102 16
345 181 128
334 128 4
265 197 8
368 324 8
39 386 4
261 187 32
268 319 4
303 338 2
45 275 16
402 58 1
286 146 2
23 298 32
393 1 2
241 91 2
257 43 128
188 339 2
45 255 2
225 308 256
...

output:

Yes

result:

ok "Yes"

Test #79:

score: 0
Accepted
time: 99ms
memory: 16768kb

input:

99935 99935
97607 93154 332918785
89358 62130 78650600
80034 75186 131967121
82362 46759 306527835
7229 52875 666669058
20917 62617 765560932
99545 58904 254387740
60694 22778 277703836
7196 61359 599301178
7330 53014 255917498
6214 51020 477816659
92110 72346 670767964
65072 76903 166547181
55647 4...

output:

No

result:

ok "No"

Test #80:

score: 0
Accepted
time: 102ms
memory: 17256kb

input:

99981 99981
25482 51509 261536997
4678 3245 253622279
645 88468 457364243
35863 85669 667939
97810 88025 302293908
40927 95674 396969982
38930 91229 216667903
36761 90729 511720243
56377 42977 218579291
42003 86164 496711373
1871 90063 467235356
38427 67520 875695651
83806 7470 675832302
83702 33256...

output:

No

result:

ok "No"

Test #81:

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

input:

99917 99917
24388 41222 479671040
83177 55832 774731421
23298 79287 990929123
4660 19428 482261415
66039 72088 933203329
90022 53249 983450598
90585 48131 785802733
22985 11158 939871264
81836 25466 813199670
60504 51044 294798743
94114 70008 959073196
90191 32955 8713875
67625 12321 894159162
20125...

output:

No

result:

ok "No"

Test #82:

score: 0
Accepted
time: 85ms
memory: 16752kb

input:

99914 99914
80312 9196 833370116
84185 39108 241697944
58172 68694 569966274
54138 8968 442953526
45922 74119 215008610
86499 94683 51240460
79877 37370 150468828
16680 49007 49141241
4163 25689 749970442
5551 76233 240309274
55083 90679 921093017
70569 90811 668695463
78292 23808 919632842
68700 29...

output:

No

result:

ok "No"

Test #83:

score: 0
Accepted
time: 89ms
memory: 16740kb

input:

99981 99981
3103 88052 321934787
72207 70020 907899927
62415 57915 599954962
33778 76486 669058268
31070 92138 970905853
52370 13309 875330281
76866 17445 348406034
75285 30446 854192710
51032 51290 312938075
22085 20655 475192399
60853 99112 629212915
64047 19104 889983832
20454 20596 555859996
742...

output:

No

result:

ok "No"

Test #84:

score: 0
Accepted
time: 96ms
memory: 16768kb

input:

99980 99980
32782 76976 750882719
64245 34464 432954865
10509 24663 537085432
10399 76875 179140035
77048 37951 475086834
67215 86936 101996524
38078 47476 473326015
36064 18554 328845413
1213 40238 742788504
81888 83398 170502176
50049 18050 415112796
77225 7566 699560243
97309 33163 790840222
3813...

output:

No

result:

ok "No"

Test #85:

score: 0
Accepted
time: 89ms
memory: 16768kb

input:

99977 99977
46775 27490 170815140
57325 42365 502462772
36797 31693 645122569
88113 35471 213376071
67228 46333 769019160
17724 82526 340007040
22366 98213 502051681
9621 92610 566095864
86970 81148 806206891
95182 74786 447930494
87794 94525 400354398
98883 64703 587028016
41141 71298 631298906
271...

output:

No

result:

ok "No"

Test #86:

score: 0
Accepted
time: 92ms
memory: 16948kb

input:

99931 99931
45096 34610 894462728
62187 7626 556602678
76484 67523 988058584
62856 6688 305126833
92054 64050 495270108
27494 98060 810415256
41172 58733 502065190
50864 94784 511005669
95388 66245 498327830
1962 70084 151803327
23685 566 668263213
36023 38653 132417587
60735 81983 422756444
87980 9...

output:

No

result:

ok "No"

Test #87:

score: 0
Accepted
time: 95ms
memory: 16888kb

input:

99972 99972
74619 47872 474607996
11549 97920 669654757
95852 86900 725721522
96461 24841 292139172
40107 78460 804019853
25269 68046 288368177
79176 1513 17656477
26013 24648 620417699
29096 43435 107194178
1066 66737 254552788
44161 90255 909425012
9572 7941 879892827
81503 55974 917521120
58644 7...

output:

No

result:

ok "No"

Test #88:

score: 0
Accepted
time: 82ms
memory: 16768kb

input:

99962 99962
94210 95045 545266489
53558 49182 128235934
6058 3590 193520377
74687 61257 876234476
24408 7174 209460295
42535 46835 807083316
59233 77735 891937140
26153 4903 217165755
43336 86079 148243396
80869 25046 395933842
53748 38899 868724187
67813 58819 190214394
46935 93064 92819628
48466 1...

output:

No

result:

ok "No"

Test #89:

score: 0
Accepted
time: 86ms
memory: 11928kb

input:

100000 100000
31453 9141 335579
29845 46034 126733
39896 57848 293149
81017 34154 19333
91468 73465 579409
18650 88879 434237
59526 50782 477277
17974 71395 52369
66583 3841 125269
32667 89602 250753
13602 70599 181361
54229 52316 349121
8786 12917 430511
68100 51561 13997
77273 58378 106531
73694 7...

output:

Yes

result:

ok "Yes"

Test #90:

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

input:

100000 100000
50797 64035 1152841
84441 85316 1089497
3370 19593 826201
46010 40232 1058767
75494 44194 699947
60779 47590 1222957
19207 60629 1208237
26182 5690 715159
93072 11794 1177801
374 18851 1236449
25365 40445 952253
11643 90741 1289803
55311 93477 732373
86433 93422 820753
9317 87854 11298...

output:

Yes

result:

ok "Yes"

Test #91:

score: 0
Accepted
time: 92ms
memory: 11824kb

input:

100000 100000
30595 16841 380200393
14236 7323 564707551
28386 7358 125619293
47525 21667 450873389
87652 85475 771299831
65158 79400 319913509
22595 63588 499841767
34617 91144 55564703
66339 49329 827634823
40382 29001 251252413
21598 27465 161004703
8845 17207 895155293
47579 28400 589347137
5757...

output:

Yes

result:

ok "Yes"

Test #92:

score: 0
Accepted
time: 84ms
memory: 11924kb

input:

100000 100000
76496 5372 851734087
97369 88063 984924503
61738 85381 343111187
35315 3377 402433643
59820 64978 677173513
23166 90825 367543117
71471 36342 56140207
76284 37064 677526929
32060 28058 755091173
2068 6299 895428973
34367 26300 495563141
50740 51824 445021793
49250 52091 120793769
64165...

output:

Yes

result:

ok "Yes"

Test #93:

score: 0
Accepted
time: 80ms
memory: 11872kb

input:

100000 100000
91967 14292 847088773
59320 6024 488917391
5418 82050 862457879
14043 88816 230570621
66797 70028 913624981
36211 22153 133856353
43401 17826 515251837
7654 80845 438358021
78899 71983 543257567
57426 18921 284578157
57398 1653 893522423
14245 30994 903194447
89734 87477 980156461
2881...

output:

Yes

result:

ok "Yes"

Test #94:

score: 0
Accepted
time: 98ms
memory: 11800kb

input:

100000 100000
10148 7953 772545751
27687 74445 318803179
47219 3943 206754161
92992 85390 717821437
24930 73990 183359107
1372 39242 338613073
74307 97443 383265089
6756 61636 750403063
74908 62649 87303719
44130 25445 779579323
62485 98269 998487463
40126 44004 324766187
80240 40457 874392227
62627...

output:

Yes

result:

ok "Yes"

Test #95:

score: 0
Accepted
time: 91ms
memory: 11720kb

input:

100000 100000
2695 87555 864497303
96654 63004 763154321
28289 26796 762890581
76976 41767 394804811
72559 96914 225142789
36523 19943 47725421
52009 15052 514384757
52447 66943 690575551
45625 48662 39383863
28282 67810 764992367
4384 31589 817706327
34445 91846 49881859
93433 5625 568669111
14 678...

output:

Yes

result:

ok "Yes"

Test #96:

score: 0
Accepted
time: 92ms
memory: 11724kb

input:

100000 100000
13046 32515 228012643
20958 6508 106160177
93488 45615 535570153
34796 71416 91316179
77866 57850 164285503
9967 12568 316578637
2725 66984 346013183
94400 11547 495310729
78393 71457 943274047
53793 13124 132513439
72333 58516 574153589
25601 20626 996458557
71330 42610 43013771
10318...

output:

Yes

result:

ok "Yes"

Test #97:

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

input:

100000 100000
69360 15311 863990557
40286 42825 881179661
84451 9317 702772193
20102 33218 275223833
49025 59087 702907741
33670 37724 725131639
11840 7624 47423773
3909 59785 61156871
69737 97885 149867381
41145 78425 760383977
54517 1899 815700001
61305 76504 260483599
6211 60834 637565923
70207 2...

output:

Yes

result:

ok "Yes"

Test #98:

score: 0
Accepted
time: 86ms
memory: 11808kb

input:

100000 100000
5045 56518 821545817
73287 95921 352980233
48100 66213 132478901
32840 29264 626310143
36375 18265 823663037
14372 18069 433676059
49914 18100 842982527
39969 36301 741059717
4610 98168 164242381
4534 79693 696926117
67640 91172 553359221
444 68632 743028877
5185 1925 210298859
60031 6...

output:

Yes

result:

ok "Yes"

Test #99:

score: 0
Accepted
time: 91ms
memory: 11728kb

input:

100000 100000
61198 43020 697584079
44055 89210 244673381
51169 51548 303044171
86078 70957 262779667
31285 4951 581866163
19862 78015 502432433
1639 45816 405533377
60275 33141 859365181
55881 43938 410458949
46570 42186 483592411
68479 67276 95988253
40366 73488 519079201
64382 95341 395201311
457...

output:

Yes

result:

ok "Yes"