QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#262340#7831. Unseen Segmentsrqoi031#AC ✓77ms7844kbC++201.1kb2023-11-23 18:38:382023-11-23 18:38:40

Judging History

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

  • [2023-11-23 18:38:40]
  • 评测
  • 测评结果:AC
  • 用时:77ms
  • 内存:7844kb
  • [2023-11-23 18:38:38]
  • 提交

answer

#include<stdio.h>
#include<algorithm>
typedef long long ll;
int a[100005],b[100005];
int y[200005];
int s[200005];
struct seg
{
    int x,l;
    operator int(){return x;}
};
seg p[200005];
ll r[200005];
int t[200005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%*d%d%d",a+i,b+i);
        y[i]=a[i],y[n+i]=b[i];
    }
    std::sort(y+1,y+(n<<1)+1);
    const int m(std::unique(y+1,y+(n<<1)+1)-y-1);
    for(int i=1;i<=n;i++)
    {
        a[i]=std::lower_bound(y+1,y+m+1,a[i])-y;
        b[i]=std::lower_bound(y+1,y+m+1,b[i])-y;
        ++s[a[i]],--s[b[i]];
    }
    for(int i=1;i<m;i++)
    {
        s[i+1]+=s[i];
        p[i]=seg{s[i],y[i+1]-y[i]};
    }
    std::sort(p+1,p+m);
    for(int i=m-1;i>=1;i--)
    {
        r[i]=r[i+1]+(ll)p[i].x*p[i].l;
        t[i]=t[i+1]+p[i].l;
    }
    int q;
    scanf("%d",&q);
    while(q--)
    {
        int l,r;
        scanf("%d%d",&l,&r);
        const int w(l+r+2);
        const int k(std::lower_bound(p+1,p+m,w)-p);
        printf("%lld\n",::r[k]-(ll)w*t[k]);
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 5652kb

input:

6
1 1 5
2 1 2
3 1 3
4 2 6
5 3 4
6 4 7
4
0 0
1 1
0 1
1 0

output:

4
0
0
0

result:

ok 4 number(s): "4 0 0 0"

Test #2:

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

input:

1
1 27 32
2
1 0
0 0

output:

0
0

result:

ok 2 number(s): "0 0"

Test #3:

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

input:

3
3 42 50
2 38 52
1 9 33
3
0 0
0 0
1 1

output:

0
0
0

result:

ok 3 number(s): "0 0 0"

Test #4:

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

input:

5
5 11 20
3 11 14
2 10 19
4 21 22
1 10 13
9
0 4
2 3
4 4
4 2
1 4
3 4
1 0
1 0
0 0

output:

0
0
0
0
0
0
2
2
5

result:

ok 9 numbers

Test #5:

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

input:

7
3 88 92
7 48 95
5 90 94
1 89 95
6 19 51
2 20 50
4 49 58
6
2 0
3 2
5 4
3 1
3 5
6 3

output:

0
0
0
0
0
0

result:

ok 6 numbers

Test #6:

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

input:

9
4 34 38
1 37 40
7 12 36
2 37 39
3 5 15
9 31 45
5 19 22
6 49 50
8 31 41
4
2 3
0 5
1 5
0 4

output:

0
0
0
0

result:

ok 4 number(s): "0 0 0 0"

Test #7:

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

input:

20
13 54 58
2 14 51
12 39 54
10 18 56
8 42 59
16 38 48
15 16 48
14 57 63
3 13 39
18 47 55
19 53 56
6 17 58
9 23 52
4 1 64
5 19 39
20 62 66
1 49 59
11 44 59
7 53 66
17 59 63
12
6 6
3 8
1 8
1 5
8 6
3 7
10 6
2 10
10 4
3 5
7 1
6 9

output:

0
0
0
23
0
0
0
0
0
1
1
0

result:

ok 12 numbers

Test #8:

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

input:

22
2 70 77
12 59 82
22 66 77
9 88 90
11 71 74
7 48 82
21 65 82
17 63 90
1 10 32
15 49 94
4 77 94
6 77 87
14 26 86
5 9 19
19 18 51
20 94 95
13 82 89
16 81 96
8 19 64
18 44 90
3 30 86
10 31 71
13
8 4
7 5
1 6
10 10
3 5
1 1
4 7
7 1
8 0
4 10
4 6
7 6
2 4

output:

0
0
21
0
5
219
0
5
5
0
0
0
43

result:

ok 13 numbers

Test #9:

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

input:

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

output:

0
0
5
0
0
0
0
19
0
0
0
0
0
0

result:

ok 14 numbers

Test #10:

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

input:

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

output:

35
17
35
119
0
0
35
0
17
60
119
6

result:

ok 12 numbers

Test #11:

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

input:

28
15 67 75
17 45 66
9 24 73
7 21 77
3 25 27
21 41 67
14 22 50
26 72 77
28 74 75
16 9 24
13 21 64
12 6 67
6 67 71
23 4 24
4 36 43
10 13 65
22 12 38
2 76 78
25 12 23
24 33 73
20 60 61
27 8 51
1 60 67
11 72 76
5 32 69
8 60 67
18 3 76
19 72 76
13
3 2
8 8
8 4
6 2
0 0
6 9
3 6
4 9
0 3
5 3
0 3
10 10
3 7

output:

178
0
0
38
505
0
14
0
299
38
299
0
1

result:

ok 13 numbers

Test #12:

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

input:

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

output:

1
0
0
0
14
30
21
30
1
3
41
3
3
0
9
5

result:

ok 16 numbers

Test #13:

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

input:

32
17 5 40
2 10 42
4 41 49
26 27 41
3 33 50
32 15 21
27 42 51
11 59 60
15 41 57
10 17 54
6 40 51
22 58 59
7 55 60
30 40 41
19 9 37
14 24 30
31 17 50
16 12 21
28 30 47
9 38 60
12 36 38
25 6 13
20 7 47
13 38 47
21 51 59
5 28 35
18 16 28
8 35 49
23 24 46
29 20 51
24 20 27
1 1 28
10
10 9
10 3
10 0
8 4
0...

output:

0
0
16
0
157
0
157
16
35
234

result:

ok 10 numbers

Test #14:

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

input:

34
7 36 38
3 46 49
19 48 53
34 56 57
25 20 44
16 6 42
8 48 55
13 48 53
2 5 44
1 33 39
9 8 47
33 17 24
23 38 43
21 37 45
30 39 50
28 31 50
18 40 52
20 21 44
24 31 40
6 46 49
5 27 36
27 19 32
31 39 42
11 44 55
12 2 22
17 20 43
14 34 56
15 16 40
26 45 56
29 26 53
4 55 56
10 48 56
22 8 24
32 4 15
19
10 ...

output:

0
0
27
15
42
0
15
0
128
15
164
128
208
94
208
305
27
94
0

result:

ok 19 numbers

Test #15:

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

input:

36
1 69 76
2 66 79
30 2 26
14 4 23
20 44 68
35 25 33
5 28 63
18 10 29
10 42 68
4 75 76
22 61 73
15 7 83
31 57 81
27 34 43
21 67 71
24 16 24
26 14 27
19 77 79
3 65 77
34 53 75
17 35 61
8 1 29
25 78 83
13 79 81
36 7 63
28 41 61
7 54 55
23 32 74
32 82 83
12 68 74
29 77 78
11 79 82
6 21 55
16 35 41
9 81...

output:

1
0
0
0
158
0
0
1
0
0
158
0
0
224

result:

ok 14 numbers

Test #16:

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

input:

38
27 41 56
19 43 47
24 59 62
32 47 68
37 39 42
3 49 56
14 21 56
33 3 55
21 46 56
20 64 67
1 17 40
5 14 47
11 33 47
30 17 26
6 46 69
31 62 63
29 16 22
22 6 29
23 11 55
18 65 69
28 63 69
16 6 65
36 34 57
34 54 57
15 24 48
13 34 56
17 2 54
35 14 67
25 44 53
9 57 61
8 22 45
26 64 67
7 64 69
10 16 54
12...

output:

79
0
0
49
25
242
49
338
199
199
1

result:

ok 11 numbers

Test #17:

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

input:

1000
934 902 1131
71 433 888
862 723 1161
416 782 794
900 277 869
335 778 850
49 439 538
228 831 1154
502 477 1109
260 47 205
550 403 533
299 217 521
567 2 280
53 872 970
673 872 1153
471 1073 1165
194 888 1046
356 493 779
990 964 1116
878 1075 1140
570 1149 1160
836 702 735
640 246 1118
381 83 662
...

output:

283380
273025
285702
274171
277613
285702
278765
270737
282223
285702
282223
277613
278765
290369
282223
286866
285702
289199
281070
282223
276465
278765
284538
282223
276465
284538
281070
279917
281070
291540
279917
285702
282223
278765
281070
281070
279917
279917
282223
281070
290369
276465
275318...

result:

ok 1596 numbers

Test #18:

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

input:

1201
850 870 1085
888 339 1003
358 1438 1441
804 1091 1477
780 1372 1464
857 210 1042
427 1302 1405
991 73 712
860 414 520
209 690 730
303 775 1286
317 1087 1134
820 1335 1406
530 1378 1449
711 1301 1435
255 119 590
1099 86 1217
840 720 984
1146 753 1063
933 308 399
231 164 293
537 1038 1368
1115 70...

output:

423179
433450
434922
418792
426109
414423
426109
417334
418792
420252
439344
429043
429043
417334
426109
426109
431979
434922
434922
437870
426109
434922
429043
429043
426109
437870
440818
412970
433450
426109
429043
420252
437870
424644
424644
420252
420252
433450
418792
427576
421715
437870
429043...

result:

ok 1479 numbers

Test #19:

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

input:

1402
492 1615 1636
727 1477 1525
1317 838 1639
900 117 887
1400 621 1552
369 597 819
1346 1702 1743
179 152 813
48 1113 1745
1297 536 1644
313 680 1291
1072 678 1749
288 809 1475
983 127 1342
216 175 763
611 1661 1669
1304 655 789
1137 1276 1749
573 1586 1590
28 1241 1711
296 866 915
473 968 1399
56...

output:

632623
627369
639639
611681
627369
611681
623874
613419
608209
634375
616896
629119
622129
616896
618639
620384
625620
622129
623874
634375
620384
632623
615157
627369
620384
629119
622129
629119
611681
636127
627369
622129
622129
632623
637882
613419
634375
623874
625620
620384
606475
622129
623874...

result:

ok 1450 numbers

Test #20:

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

input:

1603
123 1137 1238
361 129 1043
476 648 1128
1094 707 871
1240 475 915
323 993 1244
1190 173 201
1383 961 972
470 227 933
1270 691 858
1033 998 1275
15 984 1090
466 742 954
372 1108 1282
1204 258 1385
1492 1354 1373
1344 542 1228
241 39 1192
1501 840 1183
857 980 1291
349 40 536
1410 374 1072
560 10...

output:

529146
538859
531916
543034
533302
519477
519477
536079
536079
523617
543034
541640
524999
531916
544430
544430
541640
530531
538859
527763
536079
530531
520856
544430
530531
529146
527763
540249
533302
527763
538859
543034
534690
543034
531916
523617
538859
530531
520856
537469
531916
523617
527763...

result:

ok 1888 numbers

Test #21:

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

input:

1804
1382 1275 1355
1182 351 390
352 1244 1341
534 80 221
1510 413 688
140 824 933
61 486 742
992 31 868
1 582 776
1133 84 1084
1397 1049 1327
1705 20 416
592 830 907
613 365 1051
595 1223 1324
1737 186 863
380 935 1181
511 535 1105
1588 108 1181
296 408 1038
1470 602 1166
1462 981 1105
1489 1203 13...

output:

597603
596261
588234
602996
584227
585562
605702
597603
590907
597603
586898
598948
597603
594922
594922
590907
600295
594922
584227
598948
596261
597603
590907
592245
584227
589570
604349
596261
593583
602996
593583
592245
589570
604349
592245
585562
589570
588234
586898
592245
589570
588234
594922...

result:

ok 1403 numbers

Test #22:

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

input:

1000
898 1484 1636
661 792 1770
378 757 1491
855 606 1603
570 597 922
145 205 1310
139 761 1560
664 1766 1768
296 858 1197
487 1229 1608
42 1610 1778
349 1354 1721
952 1433 1685
314 776 782
247 1226 1638
637 505 559
539 1582 1599
120 168 482
818 547 1158
562 1323 1471
27 1330 1477
489 1747 1755
975 ...

output:

0
0
0
0
0
21822
0
0
7583
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
248686
0
98092
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
96953
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
289893
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

ok 1039 numbers

Test #23:

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

input:

1201
375 1286 1312
494 607 782
515 784 1375
258 602 989
204 1308 1575
123 65 641
687 131 218
1125 1257 1367
1062 1510 1523
328 165 664
1072 1070 1413
423 1373 1465
813 403 771
974 237 348
695 1513 1575
1063 1639 1642
72 914 977
771 1128 1151
506 811 1194
305 121 369
556 29 566
449 490 618
1142 635 7...

output:

0
0
0
0
0
0
132832
372955
0
0
0
0
0
144288
0
0
0
0
0
0
66135
0
0
0
0
0
0
0
0
0
0
0
36230
0
0
0
0
44558
0
0
0
286370
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
166980
0
0
1206
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
128349
0
0
0
0
0
0
0
0
0
0
0
0
0
0
405321
0
0
0
0
0
0
63...

result:

ok 1399 numbers

Test #24:

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

input:

1402
1210 1388 1416
497 1200 1556
632 1169 1591
59 137 869
1342 1641 1695
145 565 1406
274 361 437
427 215 1118
108 1558 1720
655 1290 1612
455 93 1264
486 240 248
721 1467 1607
355 352 482
831 389 747
450 1057 1376
341 123 1472
245 1620 1646
1021 1471 1632
380 573 959
1162 84 1139
681 1445 1453
158...

output:

0
58252
0
296726
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
44093
0
0
0
0
0
0
0
0
0
86426
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
293916
0
26782
0
0
0
0
0
0
0
0
0
0
0
450066
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2083
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
150460
0
0
0
0
0...

result:

ok 1680 numbers

Test #25:

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

input:

1603
1005 1171 1741
457 772 1654
405 1740 1869
803 357 943
1050 741 889
139 1725 1735
748 922 1561
200 821 944
352 1408 1457
1463 414 725
634 745 1283
208 777 1044
1253 30 1083
396 735 1650
566 1618 1694
390 1640 1792
514 1202 1625
1311 1784 1842
612 65 341
1562 205 1501
1493 51 971
659 542 1298
193...

output:

0
0
0
0
0
0
0
1645
0
0
112959
0
0
31396
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
365479
0
0
0
80430
0
365479
0
27241
0
0
0
0
331536
399111
0
0
0
383708
0
64476
0
327180
0
0
0
0
0
0
0
0
0
0
0
86002
0
0
0
0
0
0
0
0
262793
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
341746
0
0
0
0
0
0
0
0
0
0
0
0
128223
526840
0
0
52...

result:

ok 1001 numbers

Test #26:

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

input:

1804
812 532 1339
744 587 749
701 905 1191
885 219 318
6 1604 1867
352 387 1991
1160 1739 1932
1716 1048 1794
1307 305 843
732 480 1649
382 497 1572
514 1732 1920
8 849 1963
1410 564 1879
477 1382 1976
426 15 720
174 1749 1947
1382 170 885
200 77 1789
1702 235 674
143 829 1232
902 431 1389
1130 1633...

output:

608117
0
88568
0
56050
0
0
0
152211
0
0
0
0
356461
0
154508
224898
0
0
0
111922
215994
309386
0
0
0
0
0
0
157976
6214
266882
0
5536
0
331964
0
0
0
0
0
126733
186391
0
0
0
253552
0
0
157976
0
0
0
0
0
0
86740
0
0
32338
0
0
0
0
14914
52961
0
6556
124
0
0
0
0
0
46850
0
39489
0
26007
0
62464
284431
16265...

result:

ok 1970 numbers

Test #27:

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

input:

10000
863 328 812
2553 957 1455
5181 1017 1157
641 904 1424
998 1083 1283
9439 744 1366
3915 503 1361
5791 1411 1432
7204 389 835
6022 805 1177
3141 31 1158
9934 507 1110
7248 1346 1419
4275 1256 1437
8438 621 1370
1876 57 281
8602 1416 1428
522 640 1293
7228 664 971
6356 813 1188
3695 1369 1394
656...

output:

2164437
2093033
2213793
1739761
2298145
2203635
1711780
1800838
1703644
2366628
2129265
2640895
1822131
2472445
2794686
3304422
2538414
1707128
2105500
2380922
2050873
2766168
3345768
2717477
3154513
2768880
2811030
2159399
1740929
1230828
1678163
2414807
1997970
2116745
2071912
2166957
2105500
2721...

result:

ok 13245 numbers

Test #28:

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

input:

12014
803 1185 1474
1622 613 895
2794 13 1315
6228 973 1424
2455 416 641
11005 283 1250
8805 1166 1406
9335 433 1105
1689 1011 1500
4826 613 1600
5880 1084 1120
3272 1005 1448
5385 1634 1636
8462 1079 1252
10036 396 1329
1288 1294 1354
2315 910 1603
10596 1568 1602
10569 1216 1610
5872 1442 1514
388...

output:

2761293
2353898
3238102
3106035
3820554
3146042
3332519
2867812
2791570
3989214
2819207
4027880
3700835
3473643
2841385
4221284
4491994
4304696
3268511
3254014
4463261
2798471
3029332
3094635
2913893
2965810
3034994
2908295
3636139
3636139
3262711
4488798
3420490
2787433
2451804
2727014
3516667
4274...

result:

ok 19002 numbers

Test #29:

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

input:

14028
7087 681 711
2600 510 547
12197 1097 1121
3029 127 481
8271 919 1089
6944 1149 1155
10862 805 1132
7052 31 361
3792 725 835
9141 228 451
4569 109 1054
8655 945 977
2441 654 1058
2478 219 266
6743 1150 1154
948 912 970
4188 758 1068
432 14 957
4206 701 869
3795 586 1008
13104 1147 1151
6029 59 ...

output:

2383440
2904445
2136417
3340078
3321597
2761477
2496961
2716435
3724440
2688918
3408846
3283656
2122222
2667588
3382601
2881493
3253416
2474137
2185893
3106747
3309661
3758302
2873163
3065372
2880451
3428567
2796460
3112063
3255574
3097181
3367314
3390248
2450387
2860682
3978125
2763531
3389155
2109...

result:

ok 11554 numbers

Test #30:

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

input:

16042
11500 1176 1209
3931 530 1050
8799 895 1217
15152 821 907
10982 1013 1130
5884 80 252
4573 613 1197
1835 55 656
13330 478 1142
6565 746 887
6386 211 754
7768 565 709
4987 724 1128
1132 460 753
2523 886 938
9721 276 555
9500 521 1163
7926 1171 1211
14375 852 1070
11779 54 702
4326 555 660
14184...

output:

3869032
3352921
4004776
4132623
3078554
4347208
3127321
3421521
4400258
3302040
4012807
3548956
3831660
3796642
4050724
4362506
2822972
3358351
3119883
4576131
3900835
3259991
4436928
4376650
4076058
3174184
4656446
3220231
4004776
3440107
3246016
3965846
3815834
3182737
3685562
3273991
3639848
3846...

result:

ok 18839 numbers

Test #31:

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

input:

18056
5537 110 1394
138 1221 1604
13889 1614 1751
812 251 1020
15024 1562 1643
15527 438 642
10432 1128 1405
3019 397 829
17243 882 1465
2676 1693 1710
15019 158 1490
14241 1436 1542
13424 1245 1781
2731 304 1534
3215 1750 1781
11298 427 1338
15944 776 868
5138 506 1276
15862 1485 1672
14116 1238 13...

output:

6643370
6298317
6624869
5426068
6342975
6058605
5421334
6107644
7403780
5897607
6422592
5600470
6283449
6382752
5633948
7918530
5169030
6430902
6125657
7230356
6362854
6938259
7447328
7531140
6074942
6507565
6339665
4980278
7034075
6842854
5438702
6470860
6754700
6260349
5645121
6682101
6808909
7071...

result:

ok 13799 numbers

Test #32:

score: 0
Accepted
time: 43ms
memory: 6400kb

input:

100000
91630 979 994
21334 98 690
5196 462 470
20285 998 999
69153 569 943
7962 868 986
28169 97 679
94294 181 683
90340 441 826
52667 886 913
8951 156 581
64638 558 913
4862 347 433
70386 13 94
74741 28 722
48724 749 787
94472 716 775
54851 249 292
7596 935 986
22202 778 991
28802 173 630
44361 708...

output:

24072602
23908664
24502734
23561148
23758796
24458028
24126993
23845532
24201195
23915573
23788344
24594207
24117103
23901755
24457035
23454133
24388518
24009370
23553292
23682044
23740100
24580277
24388518
23989610
24124026
23965910
23952092
23674172
23646645
24010358
23974793
23531688
23963936
246...

result:

ok 100000 numbers

Test #33:

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

input:

100000
69155 309 888
3739 380 409
1126 568 694
95183 906 917
83990 615 989
80988 461 838
6901 654 834
44195 328 395
12419 617 645
15237 884 992
61835 434 882
79098 182 726
68654 399 737
55477 422 525
10319 888 953
95236 102 690
90763 949 983
82290 880 933
33502 765 884
33251 797 871
5407 522 779
158...

output:

24165494
24391537
24405439
24177374
23651314
23713313
24143726
24520717
24561501
24218954
24167474
23962831
24600306
23827640
23821724
23629688
23343992
23798060
23966783
23833556
24262536
24480957
24656051
24886367
24594336
24317096
23991483
23460715
24217964
24690911
24617221
24027051
23731043
237...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 43ms
memory: 6672kb

input:

100000
96527 534 562
53574 577 808
65394 696 719
25447 744 780
53238 156 304
34471 454 960
94065 584 752
46056 886 956
5347 401 970
2928 957 965
78370 56 395
6903 66 440
79531 935 957
95461 897 943
87183 351 525
1252 356 434
49991 969 975
24934 562 820
87118 459 794
14053 551 965
88988 651 985
84113...

output:

24282243
24247593
23835682
24210963
24642511
24894414
23949115
24067606
24485517
24446790
24096258
23870186
23882018
24718125
24118984
23565196
24343652
24347616
24109102
24635553
24494454
23872158
24412050
24719120
23687060
24785821
24592811
24212943
24346625
24609709
24552057
23965894
23249644
234...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 47ms
memory: 5712kb

input:

100000
4103 722 983
95993 101 492
28733 507 681
79374 975 983
83488 468 943
22344 182 839
67274 91 473
75508 177 568
57280 905 951
13680 317 732
20983 516 824
39368 812 947
86401 584 794
60821 679 980
45747 20 312
91609 513 833
40769 138 852
15789 29 599
17802 52 399
45153 665 949
38534 83 994
4293 ...

output:

24277493
24173556
25025706
23862474
24231953
23825043
23572395
24680750
24048985
24016381
23915718
23571413
24147842
23298917
23203127
24373617
24270563
23707979
24832155
23795523
23973939
24108282
24454040
23487993
24255713
23612657
23701098
23999601
24276503
23593017
24129051
24172567
24344878
234...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 43ms
memory: 5968kb

input:

100000
1853 979 994
42355 548 570
52547 857 944
75158 927 957
69052 164 667
74996 446 965
24009 278 454
45171 805 880
89032 328 465
25649 752 956
59233 313 903
99275 12 726
88539 253 750
58154 776 802
23992 70 904
13567 113 682
97032 217 745
82885 482 752
41112 994 998
6952 998 1000
86632 478 539
41...

output:

24362376
24062918
23889872
24565306
23668823
24480702
24601162
24354427
24148058
23731912
24044108
23231671
24517517
24175796
23589105
24108458
23776313
23599929
24576262
23995642
23671778
24107468
24031246
23500605
23737828
24084698
23430830
23654049
24072818
24077768
23187574
24298819
23967950
240...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 43ms
memory: 7148kb

input:

100000
66551 436 641
56118 677 891
28112 701 927
75772 607 637
46074 46 549
8491 371 894
96550 273 771
93727 388 848
12771 624 755
14741 750 823
3713 805 817
19507 310 512
58731 566 877
75188 762 775
91580 470 899
36121 899 939
60394 122 747
24091 894 911
14518 510 747
25498 858 957
26673 194 649
16...

output:

23403727
24693219
23801686
23896342
24407824
24465419
24089888
24291725
23470428
24013812
24360173
24013812
24146237
23400787
23997016
24143270
24062224
23620653
23725842
24409810
24552891
24323469
23789862
24502197
23752432
24289743
24377041
23196159
24171951
24161072
23432169
24235276
24035548
239...

result:

ok 100000 numbers

Test #38:

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

input:

100000
7835 78 475
55382 527 830
30483 720 997
13473 870 992
54276 42 58
94528 389 637
31215 684 836
65730 377 505
80552 302 555
57858 449 753
35722 146 273
33898 251 519
2981 142 287
13265 325 591
19019 295 563
36156 32 106
98496 435 467
38965 445 737
68396 989 997
30621 558 809
5443 605 975
30032 ...

output:

24108715
24462574
23823303
24634627
24291851
24459592
24062232
23954545
23367039
23762171
23361153
24742174
24511280
24111682
24715282
23859793
23747381
24023698
23393526
24613732
24492394
24273995
24254183
24213593
24278955
24625672
23951584
24353355
24480466
23650879
24097836
24422851
24313675
242...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 47ms
memory: 6580kb

input:

100000
51211 170 835
45013 844 990
83183 649 730
65364 581 823
94002 905 986
1648 855 903
62290 815 822
99679 132 495
56852 366 662
60830 106 863
19094 718 841
20890 978 992
77420 307 689
75580 131 211
88076 221 964
65351 227 872
97670 752 978
37254 734 818
64789 769 925
88726 442 917
71295 672 688
...

output:

24442656
24648151
23521101
24010626
24530948
23982032
24811267
23414346
24766492
24607409
24934776
23710425
23673109
24338677
24717737
24160682
24196250
24424818
24847118
24867038
24099447
24684929
23947522
23397703
24854090
24112278
24175502
24374317
24076746
23705515
24228871
24430764
24284255
241...

result:

ok 100000 numbers

Test #40:

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

input:

100000
24975 746 857
52200 473 880
17769 688 968
91750 995 1000
18432 417 656
53150 985 995
69024 392 844
79358 46 675
18786 578 692
20280 448 512
91113 137 708
7104 8 888
85121 694 775
40528 748 981
13824 44 725
46351 872 967
20164 221 876
46382 18 334
36518 734 964
23665 14 506
57145 985 989
35689...

output:

24420633
23989952
24508043
24104588
24115467
24604485
23814327
23957376
23568433
23565487
23484995
23979090
23620499
24219354
23762110
24129313
24143159
23888286
23907039
24562713
24680116
23999832
24304531
24182724
24107555
23953428
23306553
24019592
24307507
24000820
24045280
23644091
23351633
241...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 43ms
memory: 6380kb

input:

100000
49137 159 963
75266 782 953
27521 270 870
83539 215 933
31648 301 600
95355 177 289
12381 199 846
42272 718 963
59575 913 950
49576 214 379
67454 846 998
39759 951 987
36191 754 941
37624 605 802
27188 292 937
22858 413 566
89118 53 817
99232 407 666
48055 688 989
82106 172 800
70840 446 560
...

output:

23640759
23746183
24148435
24219773
24293181
24330915
23814268
24537668
23182319
23117770
24551598
23883380
24220764
24224732
24406404
24241596
23533539
23323418
24302118
24212836
24568513
24312048
24568513
23821177
23867572
23699841
24162295
23730407
24438212
24379572
23855722
23745197
23612223
242...

result:

ok 100000 numbers

Test #42:

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

input:

100000
34843 50512 80594
17112 33468 46038
24816 33616 61930
18917 69410 86650
44130 744 40589
54605 60642 92195
70476 69148 94323
86267 48642 59317
27900 76055 95594
38091 20260 21563
8658 9348 16860
12739 33315 45451
93863 53011 63295
78295 1184 22137
89568 48195 88949
6193 20951 27374
84494 81286...

output:

0
0
0
0
970769540
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1614383009
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
316272887
0
0
0
0
0
0
0
0
0
0
0
825750726
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1522044511
0
1420864270
0
0
0
0
0
0
0
0
213588329
0
0
225852472
0
0
0
564287404...

result:

ok 100000 numbers

Test #43:

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

input:

100000
43483 39029 74474
70877 15320 57110
1753 14322 77882
16851 84879 98902
91092 97236 97837
48522 95947 97459
43693 12518 28770
1262 23921 54117
59645 49642 52069
87648 58679 95949
81261 75256 80874
57336 31491 79811
66799 60038 94021
38928 77018 99405
76523 76060 76588
57819 19627 98283
32550 8...

output:

0
0
0
483922206
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
58394709
0
0
0
0
0
0
0
0
0
0
0
0
158193369
0
0
0
0
0
0
41121873
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 numbers

Test #44:

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

input:

100000
26448 4204504 4914888
39477 8255378 8535427
38480 2441348 3305383
30112 9392689 9543176
63637 9487427 9748819
90441 2277039 3160170
15204 7905242 7948429
1357 3720847 6637883
37095 7434434 9694729
47801 9170282 9616469
20280 3787629 7891008
57184 5043707 5826009
97751 3962896 5117527
4194 845...

output:

0
0
0
0
0
0
0
0
0
0
75261250150
0
0
112692585915
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
32760938356
0
0
0
0
0
0
0
0
0
10256358088
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
331231984
0
0
0
0
0
23405859953
0
0
0
0
5337482908
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
86076192261
11492338707
0
0
0
72013584897
...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 70ms
memory: 7816kb

input:

100000
18334 6188901 7743828
12764 9571142 9912560
98090 4968839 6145684
86598 7036202 7504165
60471 1357366 7462754
21646 3435982 5278374
46413 8893503 8939912
62201 4578801 5753352
77501 6631275 9809443
74012 7728229 9605255
39871 4162663 8214851
19793 2055965 2245095
32612 1117381 2731863
36263 1...

output:

0
0
0
151013376379
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5955785244
138032762721
33767424093
0
164130621811
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
161208250
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
132976121
0
0
0
2921520959...

result:

ok 100000 numbers

Test #46:

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

input:

100000
35519 2356732 2668379
55851 1420957 8619359
37776 9214600 9516732
11549 4112498 5936609
44945 202858 1988964
55504 3992536 8030600
75221 5757416 8509746
80763 3041767 5388878
36280 5295567 9507689
638 7173446 9344365
18307 6297165 7396358
87502 8746272 9495910
56543 8961343 9047145
91924 8306...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
7929220094
6028873484
0
0
0
0
0
0
0
0
0
47148849627
30056961
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3477145390
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
228001709
0
0
0
0
0
9064450411
0
228505814859
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 numbers

Test #47:

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

input:

100000
28565 6672727 9760950
47115 5161591 9172686
33944 3986604 8271672
59290 5725616 8407271
79402 3784483 6297910
36848 9788528 9944384
98420 4741595 7935371
59154 8412697 9813242
22777 352786 7699464
60155 3921805 7291074
23933 7425177 8399130
20774 9198748 9563126
14048 9123656 9303581
72574 55...

output:

63471620746
59149986048
0
0
0
0
56153304913
0
124355900645
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
54447796917
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
22752403009
0
0
0
5501473149
0
0
0
0
0
382303781
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
359951684
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 100000 numbers

Test #48:

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

input:

100000
53233 571117930 852497631
80702 782881326 950445628
96665 579138559 776192867
24108 548180013 558830357
24660 351675043 867847686
85497 269147576 468853402
86970 732663985 738033513
75707 941692728 975967394
27175 832889518 918721107
46692 623654357 701451426
31538 54738984 383054112
26791 77...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1595924361761
420076821435
0
0
0
0
0
0
0
0
0
3534998551457
0
0
0
0
0
0
0
0
0
0
0
0
17429667335732
0
0
0
0
0
0
0
0
0
0
5924168324749
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2042938960964
0
0
0
0
0
108770734935...

result:

ok 100000 numbers

Test #49:

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

input:

100000
19249 215927802 643406082
90916 868129440 954856528
64633 900348993 901050719
63873 283382876 344454880
34085 138081792 316662830
97146 174156442 823533930
45502 791671888 929165963
18245 729876586 813676797
96612 622062393 824886583
74792 378921666 786181645
37515 701132138 981560160
96318 7...

output:

0
0
0
337771033762
0
0
7401144619824
0
0
0
0
0
0
13852712161982
0
0
0
0
0
0
0
0
0
0
0
1722092804566
0
0
0
0
0
0
0
0
682262016606
0
0
0
0
0
0
8636813626650
0
0
0
0
0
0
11870689967414
0
0
0
0
0
0
0
0
0
0
0
0
0
1693300300198
47576338918
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3017162389582
783620756531
0
0
0
0...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 77ms
memory: 7844kb

input:

100000
27052 313479448 521109438
66687 321590815 491796532
7201 93610698 212779617
69719 283449118 863499265
13870 543745020 557058994
81779 489590035 651652883
32969 323109208 767887084
36465 123986687 907922951
44458 144994086 365805925
26869 67419659 675539652
80004 677578918 750437021
80974 5381...

output:

0
0
12791881931115
0
0
4269234811296
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
13573010820906
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
13573837236629
0
0
0
0
17542885136176
0
4666889294899
0
0
0
0
0
0
0
0
0
0
2391761171...

result:

ok 100000 numbers

Test #51:

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

input:

100000
1850 284950214 894023449
84626 348371136 924227859
635 614309690 699999480
27075 96775429 604299197
39855 1910112 633242495
81222 734109764 948625953
52850 120351696 704132051
21853 222355454 282682708
68902 484667903 562759396
48431 385052941 704754274
60062 713789888 843169850
44377 7393674...

output:

0
0
0
0
0
0
0
0
0
15016967821902
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
14431477694695
0
0
0
0
0
0
0
0
161574388388
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8226130889476
0
0
0
0
0
0
5855321542684
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

result:

ok 100000 numbers

Test #52:

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

input:

100000
43202 1 1000000000
16995 1 1000000000
9674 1 1000000000
46470 1 1000000000
67167 1 1000000000
84354 1 1000000000
51958 1 1000000000
45365 1 1000000000
91508 1 1000000000
59621 1 1000000000
60363 1 1000000000
65158 1 1000000000
45438 1 1000000000
98055 1 1000000000
83735 1 1000000000
99260 1 1...

output:

99985999900014
99984999900015
99984999900015
99990999900009
99983999900016
99991999900008
99985999900014
99985999900014
99983999900016
99987999900012
99987999900012
99988999900011
99996999900003
99991999900008
99988999900011
99990999900009
99992999900007
99980999900019
99980999900019
99991999900008
...

result:

ok 100000 numbers

Test #53:

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

input:

100000
38581 1 1000000000
17482 1 1000000000
78170 1 1000000000
11730 1 1000000000
96667 1 1000000000
10996 1 1000000000
9372 1 1000000000
10668 1 1000000000
86011 1 1000000000
60948 1 1000000000
5362 1 1000000000
11825 1 1000000000
84581 1 1000000000
88498 1 1000000000
81591 1 1000000000
82784 1 10...

output:

99934999900065
99934999900065
99922999900077
99864999900135
99929999900070
99844999900155
99865999900134
99882999900117
99841999900158
99980999900019
99985999900014
99984999900015
99923999900076
99892999900107
99932999900067
99866999900133
99858999900141
99890999900109
99930999900069
99927999900072
...

result:

ok 100000 numbers

Test #54:

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

input:

100000
71368 1 1000000000
70123 1 1000000000
69720 1 1000000000
87504 1 1000000000
57577 1 1000000000
90807 1 1000000000
11138 1 1000000000
33113 1 1000000000
13416 1 1000000000
24074 1 1000000000
44596 1 1000000000
50766 1 1000000000
26745 1 1000000000
88436 1 1000000000
32670 1 1000000000
27395 1 ...

output:

98601999901398
98778999901221
99423999900576
99592999900407
99358999900641
98276999901723
98769999901230
99118999900881
99247999900752
99199999900800
98564999901435
98663999901336
98901999901098
98989999901010
98873999901126
99524999900475
98494999901505
99248999900751
98896999901103
98686999901313
...

result:

ok 100000 numbers

Test #55:

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

input:

100000
79129 1 1000000000
68794 1 1000000000
62522 1 1000000000
31612 1 1000000000
61148 1 1000000000
12705 1 1000000000
33940 1 1000000000
38199 1 1000000000
92833 1 1000000000
28682 1 1000000000
12144 1 1000000000
86808 1 1000000000
87269 1 1000000000
65674 1 1000000000
65419 1 1000000000
19765 1 ...

output:

90222999909777
92952999907047
97655999902344
94334999905665
89901999910098
94037999905962
85398999914601
91768999908231
84646999915353
88903999911096
94205999905794
92027999907972
88991999911008
91892999908107
88762999911237
88059999911940
87886999912113
88069999911930
90833999909166
93009999906990
...

result:

ok 100000 numbers

Test #56:

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

input:

100000
95101 1 1000000000
2142 1 1000000000
66997 1 1000000000
39258 1 1000000000
80604 1 1000000000
74090 1 1000000000
60549 1 1000000000
19138 1 1000000000
77936 1 1000000000
51139 1 1000000000
7362 1 1000000000
7968 1 1000000000
75372 1 1000000000
60237 1 1000000000
61949 1 1000000000
93796 1 100...

output:

0
56762999943237
0
42666999957333
0
0
14060999985939
0
0
14964999985035
0
0
18510999981489
83513999916486
46016999953983
6008999993991
52802999947197
0
0
0
0
60695999939304
0
58422999941577
0
0
39136999960863
0
0
0
62580999937419
0
13145999986854
29009999970990
0
36728999963271
11855999988144
100789...

result:

ok 100000 numbers