QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664924#7157. Bikes vs Carsttamx34 20ms7304kbC++142.0kb2024-10-21 23:32:562024-10-21 23:32:56

详细

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

14 1000000
494185
494185 494185
494185 494185 494185
494185 494185 494185 494185
494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 49...

output:

26
0 1 505815
0 2 505815
0 3 505815
0 4 505815
0 5 505815
0 6 505815
0 7 505815
0 8 505815
0 9 505815
0 10 505815
0 11 505815
0 12 505815
0 13 505815
0 1 536641
0 2 536641
0 3 536641
0 4 536641
0 5 536641
0 6 536641
0 7 536641
0 8 536641
0 9 536641
0 10 536641
0 11 536641
0 12 536641
0 13 536641

result:

ok 

Test #2:

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

input:

37 1000000
891050
891050 891050
891050 891050 891050
891050 891050 891050 891050
891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 89...

output:

NO

result:

ok 

Test #3:

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

input:

40 1000000
824509
824509 824509
824509 824509 824509
824509 824509 824509 824509
824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 82...

output:

78
0 1 175491
0 2 175491
0 3 175491
0 4 175491
0 5 175491
0 6 175491
0 7 175491
0 8 175491
0 9 175491
0 10 175491
0 11 175491
0 12 175491
0 13 175491
0 14 175491
0 15 175491
0 16 175491
0 17 175491
0 18 175491
0 19 175491
0 20 175491
0 21 175491
0 22 175491
0 23 175491
0 24 175491
0 25 175491
0 26 1...

result:

ok 

Test #4:

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

input:

40 1000000
209146
209146 209146
209146 209146 209146
209146 209146 209146 209146
209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 20...

output:

78
0 1 790854
0 2 790854
0 3 790854
0 4 790854
0 5 790854
0 6 790854
0 7 790854
0 8 790854
0 9 790854
0 10 790854
0 11 790854
0 12 790854
0 13 790854
0 14 790854
0 15 790854
0 16 790854
0 17 790854
0 18 790854
0 19 790854
0 20 790854
0 21 790854
0 22 790854
0 23 790854
0 24 790854
0 25 790854
0 26 7...

result:

ok 

Test #5:

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

input:

40 1000000
750045
750045 750045
750045 750045 750045
750045 750045 750045 750045
750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 75...

output:

NO

result:

ok 

Subtask #2:

score: 5
Accepted

Dependency #1:

100%
Accepted

Test #6:

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

input:

14 1000000
494185
494185 494185
494185 494185 494185
494185 494185 494185 494185
494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 49...

output:

26
0 1 505815
0 2 505815
0 3 505815
0 4 505815
0 5 505815
0 6 505815
0 7 505815
0 8 505815
0 9 505815
0 10 505815
0 11 505815
0 12 505815
0 13 505815
0 1 536641
0 2 536641
0 3 536641
0 4 536641
0 5 536641
0 6 536641
0 7 536641
0 8 536641
0 9 536641
0 10 536641
0 11 536641
0 12 536641
0 13 536641

result:

ok 

Test #7:

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

input:

37 1000000
891050
891050 891050
891050 891050 891050
891050 891050 891050 891050
891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 89...

output:

NO

result:

ok 

Test #8:

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

input:

40 1000000
824509
824509 824509
824509 824509 824509
824509 824509 824509 824509
824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 82...

output:

78
0 1 175491
0 2 175491
0 3 175491
0 4 175491
0 5 175491
0 6 175491
0 7 175491
0 8 175491
0 9 175491
0 10 175491
0 11 175491
0 12 175491
0 13 175491
0 14 175491
0 15 175491
0 16 175491
0 17 175491
0 18 175491
0 19 175491
0 20 175491
0 21 175491
0 22 175491
0 23 175491
0 24 175491
0 25 175491
0 26 1...

result:

ok 

Test #9:

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

input:

40 1000000
209146
209146 209146
209146 209146 209146
209146 209146 209146 209146
209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 20...

output:

78
0 1 790854
0 2 790854
0 3 790854
0 4 790854
0 5 790854
0 6 790854
0 7 790854
0 8 790854
0 9 790854
0 10 790854
0 11 790854
0 12 790854
0 13 790854
0 14 790854
0 15 790854
0 16 790854
0 17 790854
0 18 790854
0 19 790854
0 20 790854
0 21 790854
0 22 790854
0 23 790854
0 24 790854
0 25 790854
0 26 7...

result:

ok 

Test #10:

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

input:

40 1000000
750045
750045 750045
750045 750045 750045
750045 750045 750045 750045
750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 75...

output:

NO

result:

ok 

Test #11:

score: 5
Accepted
time: 1ms
memory: 3984kb

input:

74 1000000
883981
883981 883981
883981 883981 883981
883981 883981 883981 883981
883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 88...

output:

146
0 1 116019
0 2 116019
0 3 116019
0 4 116019
0 5 116019
0 6 116019
0 7 116019
0 8 116019
0 9 116019
0 10 116019
0 11 116019
0 12 116019
0 13 116019
0 14 116019
0 15 116019
0 16 116019
0 17 116019
0 18 116019
0 19 116019
0 20 116019
0 21 116019
0 22 116019
0 23 116019
0 24 116019
0 25 116019
0 26 ...

result:

ok 

Test #12:

score: 5
Accepted
time: 5ms
memory: 4980kb

input:

293 1000000
699926
699926 699926
699926 699926 699926
699926 699926 699926 699926
699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 6...

output:

NO

result:

ok 

Test #13:

score: 5
Accepted
time: 11ms
memory: 6248kb

input:

387 1000000
771151
771151 771151
771151 771151 771151
771151 771151 771151 771151
771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 7...

output:

772
0 1 228849
0 2 228849
0 3 228849
0 4 228849
0 5 228849
0 6 228849
0 7 228849
0 8 228849
0 9 228849
0 10 228849
0 11 228849
0 12 228849
0 13 228849
0 14 228849
0 15 228849
0 16 228849
0 17 228849
0 18 228849
0 19 228849
0 20 228849
0 21 228849
0 22 228849
0 23 228849
0 24 228849
0 25 228849
0 26 ...

result:

ok 

Test #14:

score: 5
Accepted
time: 14ms
memory: 7304kb

input:

498 1000000
419303
419303 419303
419303 419303 419303
419303 419303 419303 419303
419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 4...

output:

994
0 1 580697
0 2 580697
0 3 580697
0 4 580697
0 5 580697
0 6 580697
0 7 580697
0 8 580697
0 9 580697
0 10 580697
0 11 580697
0 12 580697
0 13 580697
0 14 580697
0 15 580697
0 16 580697
0 17 580697
0 18 580697
0 19 580697
0 20 580697
0 21 580697
0 22 580697
0 23 580697
0 24 580697
0 25 580697
0 26 ...

result:

ok 

Test #15:

score: 5
Accepted
time: 13ms
memory: 5536kb

input:

500 1000000
399243
399243 399243
399243 399243 399243
399243 399243 399243 399243
399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 3...

output:

NO

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Test #16:

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

input:

14 1000000
494185
494185 494185
494185 494185 494185
494185 494185 494185 494185
494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 49...

output:

26
0 1 505815
0 2 505815
0 3 505815
0 4 505815
0 5 505815
0 6 505815
0 7 505815
0 8 505815
0 9 505815
0 10 505815
0 11 505815
0 12 505815
0 13 505815
0 1 536641
0 2 536641
0 3 536641
0 4 536641
0 5 536641
0 6 536641
0 7 536641
0 8 536641
0 9 536641
0 10 536641
0 11 536641
0 12 536641
0 13 536641

result:

ok 

Test #17:

score: 17
Accepted
time: 1ms
memory: 3772kb

input:

37 1000000
891050
891050 891050
891050 891050 891050
891050 891050 891050 891050
891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 89...

output:

NO

result:

ok 

Test #18:

score: 17
Accepted
time: 1ms
memory: 3664kb

input:

40 1000000
824509
824509 824509
824509 824509 824509
824509 824509 824509 824509
824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 82...

output:

78
0 1 175491
0 2 175491
0 3 175491
0 4 175491
0 5 175491
0 6 175491
0 7 175491
0 8 175491
0 9 175491
0 10 175491
0 11 175491
0 12 175491
0 13 175491
0 14 175491
0 15 175491
0 16 175491
0 17 175491
0 18 175491
0 19 175491
0 20 175491
0 21 175491
0 22 175491
0 23 175491
0 24 175491
0 25 175491
0 26 1...

result:

ok 

Test #19:

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

input:

40 1000000
209146
209146 209146
209146 209146 209146
209146 209146 209146 209146
209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 20...

output:

78
0 1 790854
0 2 790854
0 3 790854
0 4 790854
0 5 790854
0 6 790854
0 7 790854
0 8 790854
0 9 790854
0 10 790854
0 11 790854
0 12 790854
0 13 790854
0 14 790854
0 15 790854
0 16 790854
0 17 790854
0 18 790854
0 19 790854
0 20 790854
0 21 790854
0 22 790854
0 23 790854
0 24 790854
0 25 790854
0 26 7...

result:

ok 

Test #20:

score: 17
Accepted
time: 1ms
memory: 3760kb

input:

40 1000000
750045
750045 750045
750045 750045 750045
750045 750045 750045 750045
750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 75...

output:

NO

result:

ok 

Test #21:

score: 17
Accepted
time: 1ms
memory: 3612kb

input:

29 1000000
552337
552337 552337
552337 552337 552337
552337 552337 552337 552337
552337 552337 552337 552337 552351
552337 552337 552337 552337 552337 552337
552337 552337 552337 552337 552337 552337 552337
552337 552337 552337 552337 552337 552337 552337 552337
552337 552337 552495 552337 552337 55...

output:

56
4 27 349923
5 22 413859
26 28 436039
14 23 443567
12 24 445085
6 17 445569
4 16 446767
18 19 446825
2 9 447505
5 14 447561
3 18 447624
4 5 447649
8 13 447654
12 25 447656
0 1 447663
0 2 447663
0 3 447663
0 4 447663
0 6 447663
0 7 447663
0 8 447663
0 10 447663
0 11 447663
0 12 447663
0 15 447663
0...

result:

ok 

Test #22:

score: 17
Accepted
time: 1ms
memory: 3708kb

input:

38 1000000
644854
305125 329501
622065 236824 258517
48699 83625 610390 428345
701467 277887 953203 525250 385114
76769 66822 672789 788732 775160 808418
853646 260433 492908 977883 617979 867959 421170
502969 424166 347568 6763 982035 787624 793664 504750
538453 215494 17775 859568 661147 434750 87...

output:

NO

result:

ok 

Test #23:

score: 17
Accepted
time: 1ms
memory: 3968kb

input:

39 1000000
439480
439480 439480
439480 439480 439480
439480 439480 439480 439480
439480 439480 439480 439480 439480
439480 439480 439480 439480 439480 439480
439480 439480 439480 439480 439480 439480 439480
439480 439480 439480 439480 439480 439480 439480 439480
439480 439480 439480 439480 439480 43...

output:

76
5 12 108590
13 24 250386
16 19 408851
34 35 538432
8 10 539240
13 38 553144
18 31 555321
22 36 557239
8 20 560159
29 37 560349
4 34 560396
6 13 560405
0 18 560516
5 15 560519
0 1 560520
0 2 560520
0 3 560520
0 4 560520
0 5 560520
0 6 560520
0 7 560520
0 8 560520
0 9 560520
0 11 560520
0 14 560520...

result:

ok 

Test #24:

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

input:

40 1000000
812846
911882 401702
839635 826274 227560
340209 296171 94861 560840
571964 575838 494308 103484 665078
226603 679169 882216 594847 682669 947984
977195 661728 636783 21343 492814 536880 352704
6236 35639 429632 687960 183983 979198 548633 605360
26055 21697 783001 507340 363601 684140 30...

output:

NO

result:

ok 

Test #25:

score: 17
Accepted
time: 1ms
memory: 3808kb

input:

40 1000000
389519
312963 312963
312963 312963 312963
312963 312963 312963 312963
312963 312963 312963 312963 312963
312963 312963 312963 312963 312963 312963
312963 312963 312963 312963 312963 312963 312963
312963 312963 312963 312963 312963 312963 312963 312963
312963 312963 312963 312963 312963 31...

output:

78
17 21 142736
13 35 143861
24 25 453902
0 1 610481
0 26 677558
29 30 680261
15 28 681528
8 19 686027
7 13 686822
17 34 687026
16 17 687027
0 2 687037
0 3 687037
0 4 687037
0 5 687037
0 6 687037
0 7 687037
0 8 687037
0 9 687037
0 10 687037
0 11 687037
0 12 687037
0 14 687037
0 15 687037
0 16 687037...

result:

ok 

Test #26:

score: 0
Wrong Answer
time: 0ms
memory: 3716kb

input:

40 3
2
1 1
1 1 2
1 1 1 1
1 1 1 1 2
1 1 1 1 1 1
1 1 1 1 1 1 2
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 2
1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 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 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 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...

output:

NO

result:

wrong answer Contestant said no, judge found solution

Subtask #4:

score: 0
Wrong Answer

Test #39:

score: 0
Wrong Answer
time: 1ms
memory: 4436kb

input:

163 1
0
0 0
0 1 0
1 0 0 0
0 0 0 0 0
1 0 0 0 1 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 1
0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 1
0 1 0 1 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 1 1 0 0 0
0 0 0 0 0 1 0 0 0 0 0 1 1 0 0
0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 1 1 0 0 ...

output:

NO

result:

wrong answer Contestant said no, judge found solution

Subtask #5:

score: 19
Accepted

Dependency #2:

100%
Accepted

Test #56:

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

input:

14 1000000
494185
494185 494185
494185 494185 494185
494185 494185 494185 494185
494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 494185 494185 494185
494185 494185 494185 494185 494185 49...

output:

26
0 1 505815
0 2 505815
0 3 505815
0 4 505815
0 5 505815
0 6 505815
0 7 505815
0 8 505815
0 9 505815
0 10 505815
0 11 505815
0 12 505815
0 13 505815
0 1 536641
0 2 536641
0 3 536641
0 4 536641
0 5 536641
0 6 536641
0 7 536641
0 8 536641
0 9 536641
0 10 536641
0 11 536641
0 12 536641
0 13 536641

result:

ok 

Test #57:

score: 19
Accepted
time: 1ms
memory: 3748kb

input:

37 1000000
891050
891050 891050
891050 891050 891050
891050 891050 891050 891050
891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 891050 891050 891050
891050 891050 891050 891050 891050 89...

output:

NO

result:

ok 

Test #58:

score: 19
Accepted
time: 1ms
memory: 3784kb

input:

40 1000000
824509
824509 824509
824509 824509 824509
824509 824509 824509 824509
824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 824509 824509 824509
824509 824509 824509 824509 824509 82...

output:

78
0 1 175491
0 2 175491
0 3 175491
0 4 175491
0 5 175491
0 6 175491
0 7 175491
0 8 175491
0 9 175491
0 10 175491
0 11 175491
0 12 175491
0 13 175491
0 14 175491
0 15 175491
0 16 175491
0 17 175491
0 18 175491
0 19 175491
0 20 175491
0 21 175491
0 22 175491
0 23 175491
0 24 175491
0 25 175491
0 26 1...

result:

ok 

Test #59:

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

input:

40 1000000
209146
209146 209146
209146 209146 209146
209146 209146 209146 209146
209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 209146 209146 209146
209146 209146 209146 209146 209146 20...

output:

78
0 1 790854
0 2 790854
0 3 790854
0 4 790854
0 5 790854
0 6 790854
0 7 790854
0 8 790854
0 9 790854
0 10 790854
0 11 790854
0 12 790854
0 13 790854
0 14 790854
0 15 790854
0 16 790854
0 17 790854
0 18 790854
0 19 790854
0 20 790854
0 21 790854
0 22 790854
0 23 790854
0 24 790854
0 25 790854
0 26 7...

result:

ok 

Test #60:

score: 19
Accepted
time: 1ms
memory: 3772kb

input:

40 1000000
750045
750045 750045
750045 750045 750045
750045 750045 750045 750045
750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 750045 750045 750045
750045 750045 750045 750045 750045 75...

output:

NO

result:

ok 

Test #61:

score: 19
Accepted
time: 1ms
memory: 3892kb

input:

74 1000000
883981
883981 883981
883981 883981 883981
883981 883981 883981 883981
883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 883981 883981 883981
883981 883981 883981 883981 883981 88...

output:

146
0 1 116019
0 2 116019
0 3 116019
0 4 116019
0 5 116019
0 6 116019
0 7 116019
0 8 116019
0 9 116019
0 10 116019
0 11 116019
0 12 116019
0 13 116019
0 14 116019
0 15 116019
0 16 116019
0 17 116019
0 18 116019
0 19 116019
0 20 116019
0 21 116019
0 22 116019
0 23 116019
0 24 116019
0 25 116019
0 26 ...

result:

ok 

Test #62:

score: 19
Accepted
time: 5ms
memory: 4924kb

input:

293 1000000
699926
699926 699926
699926 699926 699926
699926 699926 699926 699926
699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 699926 699926 699926
699926 699926 699926 699926 699926 6...

output:

NO

result:

ok 

Test #63:

score: 19
Accepted
time: 11ms
memory: 6196kb

input:

387 1000000
771151
771151 771151
771151 771151 771151
771151 771151 771151 771151
771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 771151 771151 771151
771151 771151 771151 771151 771151 7...

output:

772
0 1 228849
0 2 228849
0 3 228849
0 4 228849
0 5 228849
0 6 228849
0 7 228849
0 8 228849
0 9 228849
0 10 228849
0 11 228849
0 12 228849
0 13 228849
0 14 228849
0 15 228849
0 16 228849
0 17 228849
0 18 228849
0 19 228849
0 20 228849
0 21 228849
0 22 228849
0 23 228849
0 24 228849
0 25 228849
0 26 ...

result:

ok 

Test #64:

score: 19
Accepted
time: 18ms
memory: 7156kb

input:

498 1000000
419303
419303 419303
419303 419303 419303
419303 419303 419303 419303
419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 419303 419303 419303
419303 419303 419303 419303 419303 4...

output:

994
0 1 580697
0 2 580697
0 3 580697
0 4 580697
0 5 580697
0 6 580697
0 7 580697
0 8 580697
0 9 580697
0 10 580697
0 11 580697
0 12 580697
0 13 580697
0 14 580697
0 15 580697
0 16 580697
0 17 580697
0 18 580697
0 19 580697
0 20 580697
0 21 580697
0 22 580697
0 23 580697
0 24 580697
0 25 580697
0 26 ...

result:

ok 

Test #65:

score: 19
Accepted
time: 13ms
memory: 5512kb

input:

500 1000000
399243
399243 399243
399243 399243 399243
399243 399243 399243 399243
399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 399243 399243 399243
399243 399243 399243 399243 399243 3...

output:

NO

result:

ok 

Test #66:

score: 19
Accepted
time: 6ms
memory: 4984kb

input:

284 1000000
635345
635345 635345
635345 635345 635345
635345 635345 635345 635345
635345 635345 635345 635345 635345
635345 635345 635345 635345 635345 635345
635345 635345 635345 635345 635345 635345 635345
635345 635345 635345 635345 635345 635345 635345 635345
635345 635345 635345 635345 635345 6...

output:

566
180 183 346353
198 247 354628
114 209 358957
40 182 361714
172 245 363283
118 260 363550
112 113 364150
123 165 364194
80 186 364307
43 48 364597
105 170 364607
17 256 364651
90 263 364653
0 1 364655
0 2 364655
0 3 364655
0 4 364655
0 5 364655
0 6 364655
0 7 364655
0 8 364655
0 9 364655
0 10 364...

result:

ok 

Test #67:

score: 19
Accepted
time: 12ms
memory: 5728kb

input:

483 1000000
403419
522267 471978
212936 940257 76971
334161 459947 694156 708157
806463 550365 700576 825569 726608
753985 6603 550332 602239 34358 185981
693778 208464 362256 672765 752997 40852 929118
916573 640331 114992 791071 487912 368137 275916 741475
719830 62722 401844 942381 111164 453890 ...

output:

NO

result:

ok 

Test #68:

score: 19
Accepted
time: 7ms
memory: 7140kb

input:

497 1000000
580648
580648 580648
580648 580648 580648
580648 580648 580648 580648
580648 580648 580648 580648 580648
580648 580648 580648 580648 580648 580648
580648 580648 580648 580648 580648 580648 580648
580648 580648 580648 580648 580648 580648 580648 580648
580648 580648 580648 580648 580648 5...

output:

992
268 348 149008
192 259 346466
30 194 393199
289 432 411965
335 467 415372
313 426 417438
225 276 417992
105 180 419043
244 362 419145
377 381 419194
13 88 419295
106 199 419307
347 469 419309
210 302 419325
14 124 419346
112 471 419346
28 128 419350
1 243 419350
17 309 419351
0 1 419352
0 2 4193...

result:

ok 

Test #69:

score: 19
Accepted
time: 8ms
memory: 5568kb

input:

500 1000000
557164
840277 711833
290274 26166 463977
521625 200536 365050 218569
527722 75647 921083 441762 905345
721686 163907 707268 264697 727595 480411
440243 460247 604508 503960 370022 148498 281212
116447 255431 423763 724292 221159 968701 583391 868361
148302 166379 32628 912700 46956 22759...

output:

NO

result:

ok 

Test #70:

score: 19
Accepted
time: 10ms
memory: 7144kb

input:

500 1000000
221407
221407 221407
221407 221407 221407
221407 221407 221407 221407
221407 221407 221407 221407 221407
221407 221407 221407 221407 221407 221407
221407 221407 221407 221407 221407 221407 221407
221407 221407 221407 221407 221407 221407 221407 221407
221407 221407 221407 221407 221407 2...

output:

998
63 278 504295
167 416 750326
136 285 776835
59 399 778419
206 233 778465
196 450 778494
100 363 778578
0 1 778593
0 2 778593
0 3 778593
0 4 778593
0 5 778593
0 6 778593
0 7 778593
0 8 778593
0 9 778593
0 10 778593
0 11 778593
0 12 778593
0 13 778593
0 14 778593
0 15 778593
0 16 778593
0 17 77859...

result:

ok 

Test #71:

score: 19
Accepted
time: 20ms
memory: 6776kb

input:

500 1000000
773628
833544 773628
346056 346056 346056
788373 773628 788373 346056
701641 701641 701641 346056 701641
830530 773628 830530 346056 788373 701641
507760 507760 507760 346056 507760 507760 507760
315780 315780 315780 315780 315780 315780 315780 315780
707756 707756 707756 346056 707756 7...

output:

998
27 331 2116
222 436 2420
115 146 2611
358 492 3990
92 491 4314
254 345 4838
166 315 5946
194 263 6590
51 185 8627
45 48 13283
327 424 13707
246 376 14227
50 295 15030
160 416 16722
247 313 17524
194 267 21544
169 277 22269
85 293 24011
346 486 25995
50 298 26380
104 283 26751
2 129 27309
326 412...

result:

ok 

Test #72:

score: 19
Accepted
time: 14ms
memory: 7108kb

input:

500 1000000
650078
560539 560539
560539 560539 650078
560539 560539 560539 560539
560539 560539 560539 560539 650078
560539 560539 560539 560539 560539 560539
560539 560539 560539 560539 560539 560539 650078
560539 560539 560539 560539 560539 560539 560539 560539
560539 560539 560539 560539 560539 5...

output:

998
0 1 349922
2 3 349922
4 5 349922
6 7 349922
8 9 349922
10 11 349922
12 13 349922
14 15 349922
16 17 349922
18 19 349922
20 21 349922
22 23 349922
24 25 349922
26 27 349922
28 29 349922
30 31 349922
32 33 349922
34 35 349922
36 37 349922
38 39 349922
40 41 349922
42 43 349922
44 45 349922
46 47 3...

result:

ok 

Test #73:

score: 19
Accepted
time: 20ms
memory: 6724kb

input:

500 1000000
585835
173900 173900
585835 890308 173900
173900 173900 283544 173900
565192 565192 173900 565192 173900
509953 509953 173900 509953 173900 509953
509953 509953 173900 509953 173900 509953 663260
509953 509953 173900 509953 173900 509953 663260 929326
173900 173900 283544 173900 753869 1...

output:

998
18 61 484
31 38 9569
2 20 16152
221 499 16152
5 35 18193
29 131 18193
183 352 18193
323 496 19991
324 350 22884
168 467 25401
80 182 27195
7 129 30498
211 494 32322
3 89 34553
8 190 35158
302 448 35158
161 183 35666
34 341 36199
14 67 44904
313 317 44904
60 226 45520
29 358 45855
140 261 48198
1...

result:

ok 

Test #74:

score: 19
Accepted
time: 15ms
memory: 6952kb

input:

500 1000000
662192
662192 769210
662192 755840 755840
662192 769210 794208 755840
662192 769210 813864 755840 794208
662192 769210 794208 755840 824417 794208
662192 755840 755840 858373 755840 755840 755840
662192 769210 826589 755840 794208 813864 794208 755840
662192 769210 812227 755840 794208 8...

output:

NO

result:

ok 

Test #75:

score: 19
Accepted
time: 9ms
memory: 5588kb

input:

500 1000000
748977
720005 720005
0 0 0
748977 751079 720005 0
0 0 0 491274 0
0 0 0 491274 0 679920
515161 515161 515161 0 515161 0 0
0 0 0 491274 0 684691 679920 0
0 0 0 491274 0 684691 679920 0 760030
515161 515161 515161 0 515161 0 0 551311 0 0
748977 762034 720005 0 751079 0 0 515161 0 0 515161
2...

output:

NO

result:

ok 

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%