QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#386004#4345. hpmo / 赫露艾斯塔alpha1022100 ✓457ms14200kbC++141.1kb2024-04-11 10:56:162024-12-03 19:50:37

Judging History

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

  • [2024-12-03 19:50:37]
  • 管理员手动重测该提交记录
  • 测评结果:100
  • 用时:457ms
  • 内存:14200kb
  • [2024-04-15 20:59:01]
  • 管理员手动重测该提交记录
  • 测评结果:100
  • 用时:459ms
  • 内存:14440kb
  • [2024-04-11 10:56:16]
  • 评测
  • 测评结果:20
  • 用时:23ms
  • 内存:10132kb
  • [2024-04-11 10:56:16]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const int N = 1e5;
const int M = 2e5;
const int B = 250;

int n, m;
int x[N + 5], y[N + 5];
int a[M + 5], b[M + 5], c[M + 5];
double dist(int i, int j) { return fabs((ll)a[j] * x[i] + (ll)b[j] * y[i] + c[j]) / sqrt((ll)a[j] * a[j] + (ll)b[j] * b[j]); }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

bool vis[N + 5];
vector<int> key;
vector<pair<double, int>> line[N + 5];

int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%d%d", x + i, y + i);
  for (int i = 1; i <= m; ++i) scanf("%d%d%d", a + i, b + i, c + i);
  for (int i = 1; i <= min(B, n); ++i) {
    int j;
    do j = uniform_int_distribution<int>(1, n)(rng); while (vis[j]);
    vis[j] = 1, key.push_back(j);
  }
  for (int i = 1; i <= m; ++i) {
    int res = 0;
    for (int j : key)
      if (!res || dist(j, i) < dist(res, i)) res = j;
    line[res].emplace_back(atan2(-a[i], b[i]), i);
  }
  for (int i : key) {
    sort(line[i].begin(), line[i].end());
    for (auto [_, j] : line[i]) printf("%d\n", j);
  }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 20
Accepted

Test #1:

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

input:

9997 9990
9019266 5863617
-9132512 9933564
-3874637 4993765
444830 -2250447
-2352800 3441144
-6132076 -4919200
-1607690 1649753
-3707230 -9677822
-4044043 949637
-7761530 2069488
9475384 4537713
-6619947 -121926
5929373 653750
5738540 -7373755
1630427 2169595
7049000 185616
-4436632 7644104
-7326158...

output:

1916
2007
6119
1014
5844
8270
8538
4803
7007
8440
4984
3791
9873
8568
7804
2407
4566
1807
5885
7221
3101
3448
9840
3758
6629
1915
2354
9549
243
644
3069
2876
5543
7486
7875
331
2530
666
5060
2306
7431
8236
1176
1329
2631
4211
7200
5814
9145
3893
5219
6443
5475
2598
4496
4798
7769
8857
409
1949
6759
...

result:

ok AC

Test #2:

score: 20
Accepted
time: 23ms
memory: 8240kb

input:

10000 10000
-9867885 -6351277
3489722 8586294
-813430 9340951
2086219 9210082
8903276 -6786767
8717742 1297662
8333166 -3317203
7936341 4929952
4912513 9933563
-4537308 -9543067
7319834 8626975
-5937113 -4470138
3427489 -6194898
-7290157 -3404718
-3724079 2294733
7598186 6969998
-9934248 6924016
428...

output:

6594
8248
9548
6479
5801
9882
5105
3276
7961
1520
7208
7378
7661
9116
489
5565
9349
3431
7252
6443
3199
2809
7371
4161
4376
4152
3887
5567
9194
7826
9562
2698
9309
3191
1212
4110
9136
7723
4329
9918
1672
9192
7375
8030
6036
9843
3182
3348
4988
7066
3798
6890
2003
3186
5426
7090
1158
3135
4183
3421
8...

result:

ok AC

Test #3:

score: 20
Accepted
time: 23ms
memory: 8396kb

input:

10000 10000
-660951 65490
-29833 2757177
-340846 10961
-7150119 33459
5136755 4278
25550 775750
5201020 -5199
75169 4666130
67597 1714309
-36541 -3114964
-4240048 31425
73017 2383801
-94770 -836461
7728250 65154
-62043 -9108010
49090 4597522
-6217034 -71671
-6369695 31577
31865 8971451
72473 9040891...

output:

7878
1529
8007
4703
3243
1495
434
1766
158
5786
8610
6103
7650
5501
7669
6856
5302
4371
4093
2081
4558
1060
8978
2712
223
2700
4268
673
6831
400
1308
9443
7534
629
5762
5880
4514
4178
1836
2441
9927
3578
8683
4653
9065
7681
7245
4230
8239
3098
5963
1052
1692
9170
6904
8927
5397
5112
7022
2753
6192
7...

result:

ok AC

Test #4:

score: 20
Accepted
time: 24ms
memory: 10036kb

input:

9998 9990
7582 3856200
9459 4381
-5500354 -8064
3998 -8251368
3506 6715096
-8509 -321964
1725 -1322233
5849831 -1846
-5027 1011243
2596 1990975
-9353 -1004281
3956 -604279
8402459 6848
5419 -2187141
8567983 -2494
1683 4015848
-7337 8293412
-7173 7399645
3799 8763972
4228499 -1835
-8493 -2845008
-833...

output:

2477
2078
4568
720
2436
3320
7260
7892
28
5838
2814
5623
7935
1395
8156
6306
9139
2418
8646
1026
6878
5217
3189
6343
7244
8811
5442
9337
8885
7648
9145
269
8901
1572
2235
9946
8726
4761
1501
7264
6903
2909
7755
2530
2617
9479
7112
3250
4622
628
8692
7689
8350
3806
9385
6390
9290
5573
3111
4101
7702
...

result:

ok AC

Test #5:

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

input:

10000 10000
-9144786 9458431
9233721 -9868159
-9349753 -9965861
9814616 9358465
9750984 -9543095
-9665224 9051130
9964223 9790510
-9960351 9771782
9534798 9181687
-9569872 -9172559
9221230 -9786591
9879500 9613336
9830155 9270397
-9866671 -9417021
9337577 9481408
9668674 -9921731
-9817467 9225012
99...

output:

4070
9563
3764
3500
565
416
9120
2643
8706
2526
8070
5070
8492
966
6082
6762
3223
4945
2326
7065
2405
2595
7212
7579
2442
4239
3287
9594
9661
514
6408
1747
4979
3057
7631
2606
5367
6173
8390
3760
3754
1127
4294
6447
7962
7176
8349
3130
2679
5789
7093
3357
1923
877
6985
6185
2947
2577
3947
960
4967
6...

result:

ok AC

Test #6:

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

input:

9990 9990
-967949 32827
-1626409 25231
3914913 -17371
-3340636 -33022
-5664776 7967173
-5125 -27879
4988706 -3540854
-9980324 -14749
2914084 -16185
-3231561 9522
1044674 19300
-3619589 16689
1056583 4919512
-141677 -29040
-2587777 -8824
8185554 -10101
-3482427 -1834
8972857 -3639730
-7063435 -8995
2...

output:

8725
1306
3530
5139
328
9618
875
6640
919
2997
5621
6821
9098
6491
3976
8346
2683
1975
4542
1027
7612
7519
6157
4508
2920
3890
3485
2120
361
9673
3075
2489
5314
5208
4147
9128
2771
4456
6618
8566
3445
5140
2706
4805
9348
8603
6387
3328
9369
3001
96
2944
322
289
5254
7986
4753
3040
8075
5756
2128
245...

result:

ok AC

Test #7:

score: 20
Accepted
time: 23ms
memory: 8772kb

input:

10000 10000
1968477 4944613
6286972 -9851737
-6437502 -4770833
1151523 -7901737
-3149643 9687929
-2205837 -376397
-1324393 5174345
3034439 6480824
-9341786 -7611299
8694184 -3435575
95532 -7378553
-428305 -2628108
263 -5693153
4995174 -4874425
-5093158 -5437311
5434124 6700984
-984539 2903531
293896...

output:

3094
5682
24
959
7026
3301
5067
2259
7751
1973
2141
661
5498
5433
7866
5327
8664
1308
8063
765
6242
7412
4858
1241
1259
4440
5156
6029
8911
8928
9158
3514
2135
2500
5068
8839
1671
1899
5026
7710
7888
3691
4302
419
551
1654
2400
2486
4449
4662
4979
5581
6092
8075
8088
7247
833
2019
6885
8427
1312
148...

result:

ok AC

Test #8:

score: 20
Accepted
time: 23ms
memory: 8448kb

input:

10000 10000
-1326300 -7573500
7443150 -8520425
9706112 5114022
-2518500 -7674600
5016700 630200
9734400 8710400
3048966 -5268394
610442 -1407578
7055300 -101500
616523 3597946
-3141466 6983439
5742991 8144648
5661864 4435109
-2226200 -4249300
-5924600 -9402400
6799900 -3953000
6648000 -8833700
80689...

output:

7674
2550
3296
9948
7564
2087
9000
5356
6976
2661
3841
9623
3128
1898
8634
7045
5658
9290
3085
3215
1438
5529
49
2624
1096
4502
1288
1373
9496
662
4304
5114
9106
309
7243
906
1366
2097
3293
7432
1491
3375
8962
7571
3812
4488
3466
3948
146
4260
778
4586
7117
8310
4286
5711
8486
4498
8362
8804
3297
81...

result:

ok AC

Test #9:

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

input:

10000 10000
-2318095 2019446
-4035918 2985975
713901 -223858
3296173 -824906
-83732 1397407
-316288 128177
-1184337 -2715514
18449 -3918764
482679 -859441
2741883 -4078535
-5781803 1089808
-2596705 -3341805
-3283602 4287650
-204221 2840836
-1521345 -11681
5377933 4075120
-862909 -1012305
-616438 -64...

output:

6756
7670
5855
7804
4569
2190
971
6210
5351
4271
6956
3218
3593
1696
8340
9518
5633
1304
2870
9303
3432
2548
171
2998
8064
2599
415
5187
588
4351
4204
8470
4639
7689
1504
1216
1494
4153
2824
381
4659
9850
4477
1626
5608
9443
2967
4593
9976
9550
2043
9096
7371
7169
1110
1111
6748
5905
3723
168
419
48...

result:

ok AC

Test #10:

score: 20
Accepted
time: 20ms
memory: 8484kb

input:

10000 10000
30399 911905
6099694 -822955
-1970492 1924582
8133655 -2339409
1225483 -1771551
-578009 -1208298
-5626070 5251285
-3033849 -8699056
5626898 3642052
-2037392 -1207307
-6932083 -3926601
7017312 -2624958
-4505258 -3199363
3196125 4153290
5919593 3128640
-5235780 -3147933
-4493757 162244
573...

output:

812
5367
1585
8407
9574
5403
4469
5452
4848
9295
470
5884
853
8258
6725
8504
2467
4039
5472
6372
7846
6689
8580
7539
406
2580
9609
1148
8028
3191
8500
5540
1879
8365
7384
8431
5648
7278
3256
1855
7818
20
7892
7150
6765
5184
2916
254
3828
1304
1567
2101
6478
1747
3261
4613
1615
1637
6868
5500
4158
35...

result:

ok AC

Subtask #2:

score: 30
Accepted

Test #11:

score: 30
Accepted
time: 456ms
memory: 13804kb

input:

100000 200000
-8961334 8961334
-7613572 -7613572
-3090937 3090937
8569374 8569374
-526841 526841
2030109 2030109
829999 -829999
6793124 6793124
-5100765 5100765
-4111697 4111697
5995701 5995701
-3387024 -3387024
1395655 -1395655
1161722 -1161722
7911524 7911524
307563 -307563
1112474 1112474
-131073...

output:

199686
68325
113455
150468
125251
5603
160925
220
5694
33541
39751
44199
65841
89667
142415
144750
184057
130774
114263
52000
123544
61730
81881
167413
186343
190292
4796
103599
115056
159042
184807
112642
141415
145077
191131
25656
57181
25835
108420
152629
53696
77790
79819
145180
156317
191254
12...

result:

ok AC

Test #12:

score: 30
Accepted
time: 443ms
memory: 13652kb

input:

99995 199993
-6901477 6901477
-1845889 1845889
934067 934067
4499968 4499968
-7373617 -7373617
9655283 9655283
9909636 9909636
3781678 3781678
8382976 -8382976
9572634 9572634
5961770 5961770
-6817835 -6817835
1707317 1707317
8703130 8703130
3783006 -3783006
-4869514 4869514
-5733646 5733646
-418580...

output:

178588
16357
137763
182146
25416
62033
149210
184984
39359
84442
876
170047
8443
56601
153803
2555
23565
160563
108301
184159
187640
16217
194057
156744
36456
37095
142000
74789
140666
17070
94011
75073
160313
138587
170416
64637
9723
18101
114809
98741
139508
26170
46015
48656
54075
140023
149918
8...

result:

ok AC

Test #13:

score: 30
Accepted
time: 432ms
memory: 13732kb

input:

99992 199994
88614 88614
7096410 -7096410
3894885 -3894885
67776 -67776
-8727157 -8727157
-29896 29896
8541631 8541631
-15653 -15653
-2318947 2318947
1990132 1990132
-7126 -7126
-2096941 2096941
87950 87950
-40903 -40903
-19865 19865
9066395 9066395
-8750432 8750432
-14428 14428
8790520 8790520
-466...

output:

172223
122472
1158
194931
115278
116047
7151
182150
108413
153115
192735
154723
166925
21268
170691
69165
158396
44541
177820
193214
112826
69943
3479
45407
193967
150015
26157
40276
42087
177887
13868
21324
111675
170298
115819
87368
135036
196248
149196
71814
68981
82813
182696
32653
5238
101041
1...

result:

ok AC

Test #14:

score: 30
Accepted
time: 446ms
memory: 13924kb

input:

100000 199990
-2262 2262
9855799 9855799
8873539 8873539
4744 -4744
-5302050 5302050
-5359476 5359476
-5002234 -5002234
-8027512 8027512
-6100 -6100
6259671 6259671
4922 4922
7251 7251
-4096997 -4096997
-693 693
-9210010 -9210010
-1651967 1651967
3644 3644
-5324 -5324
1949 -1949
7733 7733
-1155 1155...

output:

196331
34919
26968
196810
165313
193836
88356
35348
75105
187328
144220
12947
114335
95666
101564
181742
49117
100592
183546
146077
1045
19628
69044
123718
117339
112733
195274
118024
88489
78321
123014
148796
87550
83371
164760
91306
20677
42738
22075
39281
60053
24016
194821
69836
126292
176629
12...

result:

ok AC

Test #15:

score: 30
Accepted
time: 441ms
memory: 13456kb

input:

100000 200000
9046132 -9046132
-9036450 9036450
-9419376 -9419376
9775641 -9775641
-9561024 -9561024
9314457 -9314457
-9542725 -9542725
9441387 9441387
-9331034 -9331034
-9653540 9653540
-9914585 9914585
9434612 9434612
-9219316 9219316
9124798 9124798
9841837 9841837
-9145939 -9145939
9317396 93173...

output:

183368
154702
40047
123766
87594
41817
94125
147201
143348
37886
56820
57233
82507
110341
31646
137643
172767
145475
114522
43824
66761
40610
24148
25181
50348
4118
196737
61716
124379
1406
2779
3372
4806
5786
7725
8359
9351
9863
10178
10404
11974
12975
13145
13755
14494
15308
15521
16441
16626
1672...

result:

ok AC

Test #16:

score: 30
Accepted
time: 448ms
memory: 13896kb

input:

99994 199994
4956621 4956621
-4358823 -4358823
1056343 1056343
-9986 -9986
-7565 7565
3063855 3063855
-15131 15131
-943318 -943318
20729 20729
4624729 -4624729
2636623 -2636623
-19923 19923
3883762 3883762
-7257661 7257661
8029 -8029
23678 23678
-20009 20009
-7424 7424
-5431 -5431
-32667 -32667
4562...

output:

33817
48657
60083
163910
197582
40711
72260
108148
172678
66636
95298
120110
150597
158666
179810
135702
105525
168846
25730
163484
2857
24517
26093
31604
108013
148405
150089
161881
199884
24676
26029
74858
77258
123942
133370
195109
109938
152716
84774
97096
99456
137115
158646
59893
79664
118076
...

result:

ok AC

Test #17:

score: 30
Accepted
time: 449ms
memory: 13524kb

input:

100000 200000
-4834102 -4834102
5022121 5022121
6712316 -6712316
501609 501609
-6567565 -6567565
2112388 2112388
135850 135850
9040818 9040818
-7430373 -7430373
-280592 280592
-7143119 7143119
8061435 -8061435
7982642 7982642
4434783 -4434783
6517450 6517450
-1450938 1450938
5380539 -5380539
-467314...

output:

30941
176787
43368
179999
44603
15930
195779
70943
32826
74207
153783
4302
85409
78892
102939
11057
32759
11835
28867
60503
80898
81503
84723
103898
159682
167324
175818
189188
195723
158187
67724
185290
35051
31317
117348
113310
13354
104531
90523
150042
51149
99436
135274
11782
61446
39634
154267
...

result:

ok AC

Test #18:

score: 30
Accepted
time: 445ms
memory: 13840kb

input:

100000 200000
-4054600 4054600
-7279300 7279300
-7314500 7314500
-7425563 -7425563
9683145 -9683145
5107500 -5107500
8673600 -8673600
-5867000 5867000
-5227842 5227842
157100 -157100
-9963728 9963728
9768949 -9768949
-5435576 5435576
3784700 -3784700
4851500 -4851500
1340500 1340500
126129 -126129
-...

output:

82841
112972
169530
70639
60715
136220
15249
187989
35886
28426
139931
161984
33752
50168
65935
193996
187422
188744
192220
194999
162425
87795
89320
193540
196506
7622
31672
54529
124449
41769
161897
185701
55651
168791
53460
7184
92164
78114
14116
99553
54596
140146
144918
178722
194094
190764
890...

result:

ok AC

Test #19:

score: 30
Accepted
time: 417ms
memory: 14116kb

input:

100000 200000
862879 862879
1706435 1706435
3765244 3765244
-308612 -308612
-1794479 1794479
-2257534 2257534
-723517 723517
-3244580 3244580
887265 887265
-1954969 -1954969
1397202 -1397202
-318905 -318905
-4927517 -4927517
-1328060 -1328060
3126144 3126144
-2144656 2144656
1433235 1433235
3902973 ...

output:

196906
31092
129009
82123
92365
109436
119956
187414
125029
148878
167366
173835
166628
103407
91712
55556
100334
110582
139104
148205
129578
108118
48871
95925
199957
2104
144872
159580
95752
116831
196390
86151
77363
83354
49383
103411
63429
75777
132382
173604
112666
191525
176132
130097
133452
6...

result:

ok AC

Test #20:

score: 30
Accepted
time: 437ms
memory: 14016kb

input:

100000 200000
3759321 -3759321
3655283 3655283
-3682409 3682409
5518887 -5518887
127820 -127820
357474 357474
-2169485 -2169485
-6574572 6574572
-6166766 6166766
-2287638 -2287638
6842868 -6842868
6145121 -6145121
1834545 -1834545
-4493202 -4493202
-2423151 2423151
-5017153 -5017153
-1814368 -181436...

output:

16214
101541
105563
175965
92418
68937
141953
185723
51426
33407
197173
52157
11086
16208
123121
119582
189656
169443
74434
150033
180489
89717
130936
168157
31879
125680
131631
199899
101145
44059
57720
69669
107438
17176
122424
177224
102782
94341
129803
78689
23660
112967
33572
195136
194649
3585...

result:

ok AC

Subtask #3:

score: 50
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #21:

score: 50
Accepted
time: 430ms
memory: 14180kb

input:

99995 199999
5320759 3219017
-7891980 -7312757
2180279 9474165
5031926 -4436871
-7629930 762411
-9918337 2445040
7782870 -3248418
5660195 -6031840
-3452958 -2244908
9268868 -3566739
8119257 -3126185
6361275 -4963409
1043913 -6959661
7088913 -5089638
-9265623 -9227310
2423735 8343518
-4698952 8406424...

output:

110412
115732
37776
91672
117351
161895
135117
185917
51842
112482
148220
175543
192821
197365
52838
135342
8470
49719
91201
111512
121701
175028
7518
38000
520
45788
54706
56567
68200
71016
102631
105773
111172
111717
129837
180381
194147
199132
108796
185789
7490
61979
125785
161589
55151
94403
11...

result:

ok AC

Test #22:

score: 50
Accepted
time: 453ms
memory: 14192kb

input:

100000 200000
4274032 -8564615
1752457 -7056073
-7978532 8824025
-3167506 -5248972
5711527 9730398
7728051 3966415
4544367 -5526016
-5239209 -6317728
-4686212 -6910566
-9122095 -5994275
9784510 6801112
-7343677 -82634
2569012 -5796893
-9576922 -9825877
-3967715 -6763234
823556 3427207
2193794 203189...

output:

135695
170353
55485
196398
138529
157947
64369
164548
147825
50932
167516
195175
105581
45242
69606
156595
195062
155987
173023
6831
15213
42742
63969
96982
100260
110155
147869
153056
193600
16076
69404
158139
45398
63386
99111
41092
129877
143618
107286
179731
10295
134540
27580
81212
129210
13478...

result:

ok AC

Test #23:

score: 50
Accepted
time: 454ms
memory: 13928kb

input:

99997 199995
4221355 99124
-52606 7054416
7502472 60863
-80879 -2571632
-6014914 -74269
26607 5477733
-8554041 23103
-4433926 4139
93315 8678552
6410846 62326
-1633 -7998413
-790 -1445583
98650 -7841246
-60132 3337680
4830 -1929327
-79952 -1954585
55744 -6424464
-9773597 -3353
-21614 6828894
-43354 ...

output:

1973
69572
110124
166142
17980
32667
147215
61370
94519
162682
2839
132576
170740
43222
64623
191667
113483
156128
99331
127768
7166
125921
91318
92711
70373
114497
184065
154608
1738
137934
130853
89767
104574
10558
44881
100835
133845
134881
38638
198123
46762
139527
5848
94539
98030
84327
141856
...

result:

ok AC

Test #24:

score: 50
Accepted
time: 457ms
memory: 14200kb

input:

99996 199993
-7485809 497
1390443 -5441
-5401475 8919
9194227 -8110
-5001 -1917281
-8122 -4750988
3536148 -3021
2408 -7035391
9543167 -3551
-9884 -7750908
-1174 433673
-5517092 -5840
2404624 7663
-2932745 -9442
9878 -1142401
-40 -6333670
-440 5237984
441 4663960
6850 5556721
-4644 7013362
5085996 -5...

output:

51191
7313
27700
129680
110931
137708
2302
143710
118301
159875
197455
46318
61164
3742
55008
183008
12820
39440
91588
89042
12090
85514
86046
6175
178757
69585
15630
105888
64032
104907
30937
82953
104711
129879
152840
86526
134822
56833
126617
138216
139578
150220
33991
176477
182076
33275
29153
6...

result:

ok AC

Test #25:

score: 50
Accepted
time: 436ms
memory: 13508kb

input:

100000 200000
9836027 9259046
9141664 9853111
-9592540 -9234225
9395407 -9818901
9155502 9005445
-9035350 -9065876
9148785 -9976277
9250953 9602169
9564656 9758527
-9991922 9362223
9638786 -9994059
-9519393 9169397
9455605 -9117629
9610585 -9723463
9397071 9523003
-9770348 -9131324
9430686 9493469
-...

output:

14670
45803
49220
90585
176155
142388
2346
70550
165285
154545
33694
187969
18703
86604
195807
6917
2803
5172
25512
7809
22663
26709
28186
30419
125118
135192
160246
166375
126012
129302
158448
239
90297
114148
18542
194523
158982
19431
190614
103686
14193
34846
161927
35703
98927
89786
67023
8405
8...

result:

ok AC

Test #26:

score: 50
Accepted
time: 446ms
memory: 13924kb

input:

99998 199992
8965847 -33318
-2822530 17955
3291890 19895
6404732 -33096
-4434952 -7491900
1850415 4902
-2754428 -4964511
-6757281 -23208
3492139 -9242
-7393956 1730858
-2448932 -29478
9781425 -20171
4105143 7574939
5191560 1452540
-9242683 -4228
-4230820 -4813
4039260 25453
-26169 27979
158858 30833...

output:

94946
77177
85811
55057
138616
92082
49160
49462
197691
123205
145540
8763
74177
194935
119993
36714
142254
170358
10532
93144
121878
155435
143143
100800
167752
55498
97968
189381
81476
29349
64713
61753
81633
94893
57433
164588
72980
5963
182131
180947
7419
67411
59541
95924
75271
99663
163397
361...

result:

ok AC

Test #27:

score: 50
Accepted
time: 444ms
memory: 13416kb

input:

99991 199999
-4778141 6528999
4681620 6930238
8098538 9671950
-6158979 9000870
-693504 -1820831
3125268 391519
9337880 -458792
-7176026 1646623
-6517399 -3830364
-8768363 -6040522
-6722047 3633670
2719325 3251406
3328318 9817233
-204781 6152270
9951727 1109754
-3881139 -1413837
-6042033 -4971163
695...

output:

19046
51162
174751
38795
12576
75651
199805
99819
171050
68078
136799
94940
135121
139250
83492
181211
81414
90553
153629
2677
57346
44112
4217
15934
57342
112618
129111
3566
39465
155756
182709
196783
42443
59990
84439
89995
141421
180980
182503
703
149153
169441
32920
59135
166708
169991
185141
19...

result:

ok AC

Test #28:

score: 50
Accepted
time: 455ms
memory: 14084kb

input:

100000 200000
-1744459 -8428180
-3155400 -7807900
-1953045 -3236722
6760721 2177110
-565496 2234942
922485 -1941246
2272900 -7446700
-2122631 6043836
8207129 -9929791
-7681076 3410905
1342300 2529900
8212961 -7115599
-1956900 -5681600
-1861593 -154191
35500 6507000
2403473 -276174
-6955200 2729300
-...

output:

112361
158395
1705
158704
100652
122015
8606
21548
86021
101691
117852
143205
86034
62072
17302
7033
8566
13913
46871
117886
128821
135011
176298
33991
86181
154945
94501
44196
106488
108536
153885
180511
171524
2511
121269
194426
4479
8038
29926
45424
63427
67404
74828
79865
87316
112821
118251
125...

result:

ok AC

Test #29:

score: 50
Accepted
time: 451ms
memory: 14016kb

input:

99995 199995
-2481916 -1069451
-2865135 1293145
82997 -5359290
1272006 2556169
783178 -1900007
-3873534 6407112
1782675 -3201962
3526316 -2582971
-3469418 -3259646
1238110 -2115857
-2695529 417070
-2122003 1210063
3593136 1365617
74629 5321678
1678034 1570779
3448419 -4554050
2584010 2489252
5234418...

output:

183620
136386
77468
97106
169331
26594
182521
100923
25536
177109
99603
134715
172111
59612
100513
45920
165069
66524
102614
153550
153948
35269
66825
73865
76693
104100
134359
167368
53411
38641
191116
83932
26358
1286
4819
24219
38464
70912
76209
77800
78707
117871
145035
170407
177346
7346
194034...

result:

ok AC

Test #30:

score: 50
Accepted
time: 453ms
memory: 13888kb

input:

100000 200000
-1007327 669624
5756005 -746672
-54422 5968122
5710841 1217489
-7980712 -460049
-2209478 2805265
-8072576 276441
65075 -2428003
253080 -1498180
1823714 -6230033
-7219178 -3498801
-3554627 -14377
437142 -5724539
1736810 3638150
518595 -3074244
1821457 -5798646
-3022760 5457195
1826452 -...

output:

26632
40809
52496
168960
21201
82899
179568
135340
157927
147373
176811
170254
42409
38803
91068
31240
99752
9875
33939
80121
96362
111160
190222
28589
153859
158100
95736
107682
10471
72528
34529
38924
149920
155915
156340
22039
176170
32847
143932
13001
67206
162378
153073
92857
159215
18779
19360...

result:

ok AC