QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#111737#3141. Foehn Phenomenaminhcool100 ✓104ms6732kbC++141.5kb2023-06-08 10:22:512023-06-08 10:22:53

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-08 10:22:53]
  • 评测
  • 测评结果:100
  • 用时:104ms
  • 内存:6732kb
  • [2023-06-08 10:22:51]
  • 提交

answer

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC target("sse,sse2,fma,avx,avx2")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define int long long
#define fi first
#define se second
#define pb push_back
//#define mp make_pair

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;

const int N = 3e5 + 5;

const int oo = 1e18 + 7, mod = 1e9 + 7;

mt19937 rng(1);

int n, q, s, t, a[N];

int diff[N];

int cal(int x){
    if(x > 0) return x * s;
    else return x * t;
}

void process(){
	cin >> n >> q >> s >> t;
	for(int i = 0; i <= n; i++) cin >> a[i];
	for(int i = 1; i <= n; i++) diff[i] = a[i] - a[i - 1];
	int total = 0;
	for(int i = 1; i <= n; i++){
	    total -= cal(diff[i]);
	}
	for(int i = 1; i <= q; i++){
	    int x, y, val;
	    cin >> x >> y >> val;
	    total += cal(diff[x]);
	    if((y + 1) <= n) total += cal(diff[y + 1]);
	    diff[x] += val;
	    diff[y + 1] -= val;
	    total -= cal(diff[x]);
	    if((y + 1) <= n) total -= cal(diff[y + 1]);
	    cout << total << "\n";
	}
}

signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	//freopen("cave.inp", "r", stdin);
	//freopen("cave.out", "w", stdout);
	process();
	//ll t;
	//cin >> t;
	//while(t--) process();
}
/*
2 3 9
1 0 0 20
1 0 2 15
1 1 1 12
2 0 0 0 2
2 0 0 1 1
1 0 1 6
1 1 1 14
2 0 0 0 2
2 0 0 1 1
*/

詳細信息

Subtask #1:

score: 30
Accepted

Test #1:

score: 30
Accepted
time: 3ms
memory: 3492kb

input:

1999 1999 1 1
0
361955
578909
-854798
-859726
514839
-30508
-111746
-597624
-847947
-823507
402362
860826
580634
-130241
-861004
-491067
-972576
263274
82135
-787505
-436755
-610884
113239
-852249
800710
151322
-699362
-415053
844863
-929401
573522
123399
467286
-768486
265085
373884
-310011
-428889...

output:

653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117
653117...

result:

ok 1999 lines

Test #2:

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

input:

1998 2000 109 330
0
955722
978070
-904438
142717
-981711
-160448
-192233
-981992
-554688
-426353
367412
-324002
-254777
-485943
-104144
-909219
350106
112473
36699
939972
283616
-10951
710934
335883
992349
698607
-623972
-834077
-664857
610984
674410
877503
-531816
-363914
-373775
811400
-436217
945...

output:

149672516125
149672516125
149686999139
149626414420
149775169962
149930065326
150052178876
150052178876
150251990059
150345737596
150421369542
150421369542
150445252791
150447561578
150529274118
150529274118
150538813583
150577932793
150606194273
150586449691
150695148541
150695148541
150695148541
1...

result:

ok 2000 lines

Test #3:

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

input:

2000 1999 1000000 1
0
-822890
575619
290108
298828
594187
-120915
-536994
-461056
323058
-891907
6087
-574727
916424
-77037
-736738
-520272
-825661
-810235
399799
385654
548257
-50401
110603
-182132
473633
-341746
218046
-729024
-950520
203705
-205573
-869190
-150662
50114
-985700
-17556
-146756
407...

output:

-674283349448664
-674716599015414
-674355659376354
-674749045982967
-674749045982967
-674882980849032
-675015282716730
-675376103355909
-675349115382897
-675349115382897
-675255091476921
-675934521797490
-675662152069860
-675563604168408
-676114676617335
-676114676617335
-676114676617335
-6762202135...

result:

ok 1999 lines

Test #4:

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

input:

1999 2000 1 1000000
0
-326155
698706
-361303
494873
-823200
729751
-990146
217740
-905858
-643105
171560
602200
-908112
-963540
-868182
333445
161465
623589
-206071
181704
226840
-656937
653766
-76289
945797
8764
892705
-492697
150370
-113541
-962077
449175
-74295
-288291
172512
962497
73538
-129381...

output:

662019090931669
662019090931669
662657803292956
663342133608625
663598129352629
663327931622827
662612775337984
662612775337984
662849641101118
662942923007836
662942923007836
663316061634697
663302460648298
663307194643564
663606216344542
663606216344542
663606216344542
663606216344542
663606216344...

result:

ok 2000 lines

Test #5:

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

input:

1998 1999 39194 1342
0
-389958
-105816
48063
289390
840928
530064
370578
751367
-750967
228637
-317089
330182
458015
38457
599592
690516
-714444
832251
-480239
-917794
-977746
-892773
-982885
622563
669736
-20473
-554287
-583444
-276929
881292
-4791
-294799
566441
641600
423530
846296
-107758
177247...

output:

-25383041918258
-25383041918258
-25383041918258
-25386340530798
-25386340530798
-25386340530798
-25384064527890
-25370983936546
-25370983936546
-25370983936546
-25366070784798
-25366070784798
-25358233717458
-25381829329438
-25418209946494
-25416977333966
-25406721750938
-25419047838366
-25419047838...

result:

ok 1999 lines

Test #6:

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

input:

2000 2000 235627 132422
0
-697952
464545
651411
428248
144440
989276
923188
-3555
798070
-489331
-69585
-206825
937637
518989
-699237
134611
767998
-100067
853023
-982648
-549897
-846128
-239660
-806554
-128194
-360117
-939601
454429
-326450
3606
-606765
-143707
-17797
966527
-500389
-518102
654314
...

output:

-69207125919625
-69122545293925
-69122545293925
-69212876811840
-69255610699780
-69308768189515
-69281721461575
-69290944273195
-69338015041645
-69327210406990
-69312483879130
-69318810345630
-69318810345630
-69268040297160
-69268040297160
-69294765231910
-69294765231910
-69324478673845
-69366339241...

result:

ok 2000 lines

Test #7:

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

input:

1999 1999 122982 235253
0
107931
-755301
-148779
-162597
299555
46127
585876
11462
340479
-969046
800505
-163162
-758350
986169
233844
-111874
303734
708008
797823
870328
-657722
671013
-679056
-953280
-858138
-185355
-585870
-475016
-35631
497532
818761
482172
-431222
-851205
491432
570095
42904
80...

output:

75123983193887
75152893537742
75173950188334
75170727561550
75219245249658
75219245249658
75209066087172
75234919740781
75234919740781
75323032716085
75334632747271
75359088514659
75359088514659
75459953230143
75459953230143
75568956245875
75620970165194
75691527885583
75691527885583
75691149981397
...

result:

ok 1999 lines

Test #8:

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

input:

1998 2000 93018 224222
0
729204
127371
704700
710677
-562539
875222
763021
-341156
-900907
191047
-775310
944999
-556138
923125
-308032
306014
-404896
-875523
-436501
669783
-794077
-947921
-930439
771870
-444632
536826
-402207
547196
-708021
-735510
-700411
-964687
424636
-598446
-884027
918604
801...

output:

85889927458396
85889927458396
85946048132540
85917324428044
85995506267564
86037037844132
85977198192608
86019429611312
86088277335864
86088277335864
86133309303948
86145107298832
86145107298832
86225735043320
86166443955720
86227417865824
86227417865824
86329596654536
86288813334380
86288813334380
...

result:

ok 2000 lines

Test #9:

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

input:

2000 1999 1000000 1000000
0
655003
-918777
426029
569111
19284
-592535
76598
-958709
842226
764636
-108210
-196932
956132
814859
569928
-868927
512111
-218712
-846442
540976
954339
-603003
293290
584561
930480
719602
214247
66890
740156
-870285
-957422
417969
-279698
-918659
-529296
-518940
-116053
...

output:

-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-506553000000
-50655...

result:

ok 1999 lines

Test #10:

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

input:

1999 2000 2 10000
0
-159979
-682210
-270757
-682735
-818656
-458084
-312859
408125
-184782
618120
105927
607705
-556120
91919
1163
-362014
571231
602939
-466840
-252965
810476
366137
-290432
974751
54809
610506
-816191
-874612
-705892
798725
-264888
-975062
294662
888137
537711
-61492
178119
258135
...

output:

6412468825738
6420910387088
6428167395396
6429626703476
6429626703476
6429626703476
6429626703476
6430571554468
6430970984566
6425098549288
6422634762144
6418215526168
6420967055752
6420986431876
6420986431876
6417534022496
6416927263872
6421701258882
6419361726882
6419361726882
6421454378268
641934...

result:

ok 2000 lines

Test #11:

score: 0
Accepted
time: 4ms
memory: 3640kb

input:

1998 1999 1000000 1000000
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
...

output:

-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
...

result:

ok 1999 lines

Test #12:

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

input:

2000 2000 100000 1
0
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
...

output:

-99998000000
-199997000000
-299996000000
-399995000000
-499994000000
-599993000000
-699992000000
-799991000000
-899990000000
-999989000000
-1099988000000
-1199987000000
-1299986000000
-1399985000000
-1499984000000
-1599983000000
-1699982000000
-1799981000000
-1899980000000
-1999979000000
-2099978000...

result:

ok 2000 lines

Test #13:

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

input:

1999 1999 999999 934523
0
826953
-345979
469912
-778086
-369353
-108678
-482263
-757316
817692
-793202
-640774
-562543
129599
-492225
-754905
810222
896583
-196495
-259867
310
-599531
-790687
-746446
624905
536313
718164
-596944
-359196
41377
-419301
338848
292199
46630
-352044
-833058
-471753
76927...

output:

-42195916939915
-42008244162009
-41233952606543
-41584304344720
-42089243008511
-41844290512366
-42012653241523
-41947664643057
-42296615531257
-43067870104657
-43955536216990
-44795458377067
-44848361324164
-45671663500861
-44971971200554
-45446217726307
-45182180990344
-44225566946959
-43911513261...

result:

ok 1999 lines

Test #14:

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

input:

1998 2000 985161 444
0
-576073
-829301
322046
913701
-700198
200786
947920
-309447
-262260
-986828
-743822
106359
258014
-569324
413197
-412832
478295
-106815
382773
432542
522839
-933836
-898058
349529
-456273
-18616
-500567
279834
872649
671900
-247533
-495788
726948
-799409
-442373
-931955
314740...

output:

-649848259985886
-649736609818275
-650298868454520
-649849520423646
-649987958832525
-649900412567640
-650201140215855
-649913667843177
-649828045715310
-650741424892245
-651702916357083
-652024568256831
-652926738400155
-653021586341595
-653302239549048
-652875034849353
-651991694464503
-6523465677...

result:

ok 2000 lines

Test #15:

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

input:

2000 1999 992452 945243
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
10...

output:

-992452047209
-992452094418
-992452141627
-992452188836
-992452236045
-992452283254
-992452330463
-992452377672
-992452424881
-992452472090
-992452519299
-992452566508
-992452613717
-992452660926
-992452708135
-992452755344
-992452802553
-992452849762
-992452896971
-992452944180
-992452991389
-99245...

result:

ok 1999 lines

Test #16:

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

input:

1999 2000 234534 190909
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
10...

output:

-278159000000
-321784000000
-365409000000
-409034000000
-452659000000
-496284000000
-539909000000
-583534000000
-627159000000
-670784000000
-714409000000
-758034000000
-801659000000
-845284000000
-888909000000
-932534000000
-976159000000
-1019784000000
-1063409000000
-1107034000000
-1150659000000
-1...

result:

ok 2000 lines

Test #17:

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

input:

1998 1999 222 999999
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
10000...

output:

-259023828
-385928130
-581515458
-739682466
-831572928
-958160658
-1101742488
-1181252010
-1374709914
-1471053918
-1491180216
-1605142362
-1707991854
-1870344672
-2085069732
-2263177890
-2299392528
-2497333944
-2618393208
-2692600704
-2732220822
-2833715448
-2898414684
-2974321146
-3019307448
-31305...

result:

ok 1999 lines

Test #18:

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

input:

2000 2000 213456 909090
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
10...

output:

289826155758
881127577170
1069335529674
1589151514344
2199342877026
2633796917922
3177150374616
3765395180232
3960690251928
4272033074406
4378112389968
4671747153342
5021075766024
5284467145614
5761327730784
6327201642594
6408249959934
6415986801282
6812183754714
7322139127434
7621111490490
76884537...

result:

ok 2000 lines

Test #19:

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

input:

1 1 1 1
0
0
1 1 -1

output:

1

result:

ok single line: '1'

Test #20:

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

input:

1 1 1 2
0
0
1 1 1

output:

-1

result:

ok single line: '-1'

Test #21:

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

input:

1 1 1 1
0
0
1 1 0

output:

0

result:

ok single line: '0'

Subtask #2:

score: 10
Accepted

Test #22:

score: 10
Accepted
time: 87ms
memory: 6684kb

input:

199999 199999 1 1
0
959891
-343065
13581
237746
860327
-320318
907303
-148121
-692995
154478
-346488
-713761
901786
-882286
179062
-734254
345880
-375432
646742
-663178
793986
-769588
-464537
188558
-725826
215198
-567993
-518760
844631
-396749
3182
-616994
584696
20180
-512289
-928005
-741421
-8710...

output:

284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267
284267...

result:

ok 199999 lines

Test #23:

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

input:

199998 200000 109 109
0
-69725
211444
347083
-523022
-970942
509266
295190
77072
-3930
-544073
930225
912181
324210
696136
-160034
-298376
649585
-275966
850624
788098
-915712
-988587
274683
551282
-328471
-215242
-943378
-204717
-131644
562122
-793698
-132091
862078
182602
-256876
329126
756562
979...

output:

-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
-72171298
...

result:

ok 200000 lines

Test #24:

score: 0
Accepted
time: 90ms
memory: 6524kb

input:

200000 199999 1000000 1000000
0
132400
589991
345399
697956
-973355
206404
-774838
-920617
-703056
-378438
-203720
-533083
493927
444942
-762739
-606050
-371552
-819661
991171
-996529
72490
367019
-60653
-522555
645250
347645
-505267
-323464
560167
944385
799989
200658
605109
420594
-278261
603293
3...

output:

-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-553491000000
-55349...

result:

ok 199999 lines

Test #25:

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

input:

199999 200000 1 1
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
...

output:

-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-10...

result:

ok 200000 lines

Test #26:

score: 0
Accepted
time: 73ms
memory: 6684kb

input:

199998 199999 39194 39194
0
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1...

output:

39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
39194000000
...

result:

ok 199999 lines

Test #27:

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

input:

200000 200000 235627 235627
0
846595
-848699
846881
-71717
552923
-151808
-715395
441105
-841594
198617
847724
-810729
727913
976229
404825
355250
-834117
367882
-558166
-961041
-935124
139141
905206
-475326
423370
-958417
660456
-66122
258630
-549575
-638164
520723
379599
348484
839036
932240
-3887...

output:

291105377150
356788052789
529477667327
381303392750
457009169715
521499337107
536777391787
661013848180
725721499293
886658981579
1107779134070
1240264891733
1112096056337
1034825009211
1042312292763
998336990126
1216996254229
1020327822409
898806495937
830689557761
726795015905
564239718637
6519822...

result:

ok 200000 lines

Test #28:

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

input:

199999 199999 122982 122982
0
634808
-502795
361344
956733
-645328
816696
102888
380400
-834885
691026
694082
-784011
-498
-379009
-163225
-335798
562378
809207
971502
-6858
296701
894120
-815877
-607658
822544
271385
923082
781870
799728
-82200
612434
306469
-776348
891970
-382647
358803
-908114
19...

output:

-7087575642
6767453496
-14837532336
25371801510
-9508722276
57772393266
122413208250
38876208966
61356826638
-42688036056
-49666526664
-61289309520
-36704100882
-115091597862
-11527225842
-98218098516
-114004682946
-174238069014
-178998579252
-141671451558
-70778231694
22815374676
-15144372426
-9130...

result:

ok 199999 lines

Test #29:

score: 0
Accepted
time: 90ms
memory: 6680kb

input:

199998 200000 93018 93018
0
-216074
-621013
-137975
-707793
-153440
-445416
-787188
-174221
-790107
-536950
849045
504647
-999034
-223205
-312500
-889070
-912819
-981334
-993343
-847036
193618
918953
-833195
-963652
-282549
-457391
460836
-113434
-105166
601685
-338601
37992
226836
-872198
477703
22...

output:

-51219338502
-51219338502
-51219338502
-44781376686
-44781376686
-44781376686
-85429405524
-44612828070
19699631094
19699631094
19699631094
35517062940
-3085034988
-3085034988
10472896620
-894368070
-90717943914
-90717943914
-127396150548
-218580951804
-246702525636
-246702525636
-246702525636
-2467...

result:

ok 200000 lines

Test #30:

score: 0
Accepted
time: 74ms
memory: 6656kb

input:

200000 199999 1000000 1000000
0
-727176
-307153
555239
-664277
706272
554350
190373
838781
-372771
342248
151354
-569761
-542459
-960211
698729
-576845
-172021
-899960
-366064
845006
-861669
-726576
609798
503943
60512
201349
-705641
-531122
542165
-927119
223204
-743654
616696
-654772
182937
982128...

output:

-221759000000
-925797000000
-925797000000
-925797000000
-925797000000
-1512421000000
-1512421000000
-1512421000000
-1512421000000
-1512421000000
-1512421000000
-1700604000000
-2658626000000
-3383549000000
-3383549000000
-3383549000000
-2576441000000
-2576441000000
-2576441000000
-3361225000000
-3361...

result:

ok 199999 lines

Test #31:

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

input:

199999 200000 2 2
0
-611443
20517
-557697
-924226
-139186
-543005
-494535
-72949
298069
-9506
-391493
-362636
958027
404999
-797079
-6087
18598
192867
-563070
-982786
957373
-327468
-575744
-992064
-167594
-965222
-177111
-380145
-803339
-939807
-744111
-411481
692575
-775311
-988494
-436974
477634
...

output:

-1434462
-2728612
-1681936
-1681936
-235976
-235976
-235976
1671962
-228640
-228640
-228640
-228640
-228640
-228640
-228640
-624772
-2061126
-3504160
-1572706
-1572706
15662
15662
15662
15662
-330386
1663470
1663470
-162936
65596
65596
-853560
-2127014
-2335792
-2335792
-3004248
-4631974
-5446702
-3...

result:

ok 200000 lines

Test #32:

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

input:

199998 199999 1000000 1000000
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000...

output:

-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
...

result:

ok 199999 lines

Test #33:

score: 0
Accepted
time: 66ms
memory: 6688kb

input:

200000 200000 100000 100000
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100000...

output:

-68872200000
-30694600000
48529200000
74199000000
136330000000
149290400000
246533600000
286359600000
370740700000
439401800000
492272600000
523851700000
612761300000
651112100000
741320800000
833651000000
868668100000
961173900000
976184500000
1055665200000
1079654000000
1118418700000
1149452400000...

result:

ok 200000 lines

Test #34:

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

input:

199999 199999 999999 999999
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100000...

output:

-1871051128947
-2678621321376
-3280646719350
-4237331762664
-4925436074559
-5231673768321
-5426267573727
-6165163834830
-6962282037711
-7930211069781
-8896213103778
-9382112617878
-10343194656795
-10395255604734
-10642959357030
-11324711675277
-11331251668737
-12082519917468
-12869162130825
-1348067...

result:

ok 199999 lines

Subtask #3:

score: 60
Accepted

Test #35:

score: 60
Accepted
time: 64ms
memory: 6732kb

input:

199999 199999 1 1
0
173234
-927920
674265
244933
-404760
82932
219154
-330462
-602045
-297954
-936143
465791
627953
-853988
890893
665370
350915
468704
-604989
83237
889756
386366
-693949
-944375
672570
914665
384141
-419168
464457
-166099
-49743
48836
-630409
-328740
971362
928078
504477
-807494
-5...

output:

224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826
224826...

result:

ok 199999 lines

Test #36:

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

input:

199998 200000 109 330
0
-91233
39049
188825
886169
196896
308216
940918
-472860
-470105
-207557
-577193
228251
885437
-319743
558836
645357
-22788
895952
115291
251143
238169
897811
955110
942429
-972057
-908314
713389
-197401
546348
-248084
-309874
-558178
-98646
300968
998590
467219
371222
896386
...

output:

14714119072321
14714193289425
14714258713160
14714339830105
14714466490509
14714459582270
14714549152686
14714491249802
14714575382734
14714580955912
14714580955912
14714728566895
14714836177983
14714985428344
14715110122290
14715175246128
14715284394934
14715338846019
14715338846019
14715338846019
...

result:

ok 200000 lines

Test #37:

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

input:

200000 199999 1000000 1
0
-898732
938374
-4423
-958849
348515
308514
-985854
-114650
647710
382155
126213
-181908
378185
-962863
533049
-773440
-478423
511853
-645325
320195
-913730
849711
-832561
479122
-54940
477114
367702
731175
120877
161148
569973
-933231
679534
351142
-869776
-454974
9161
9355...

output:

-66621985263219583
-66622801682403163
-66622801682403163
-66622801682403163
-66623461580743264
-66624210115994728
-66624204738000106
-66623994922209922
-66624192313012531
-66624822375382468
-66624822375382468
-66625411007793835
-66625872562332280
-66626657357547484
-66627626873577967
-66627626873577...

result:

ok 199999 lines

Test #38:

score: 0
Accepted
time: 68ms
memory: 6732kb

input:

199999 200000 1 1000000
0
-850918
725224
348475
-11870
-582585
153644
840818
39128
-650514
657756
-812249
-690019
485728
-324328
-66064
-947482
194504
-111096
147779
-80686
356758
858646
-581257
-163400
-121889
912782
953923
397630
330277
584780
179272
-730198
-287852
484730
-914831
-939118
600271
6...

output:

66565807561590720
66565923251475030
66565923251475030
66565923251475030
66566170691227590
66566251484146797
66566214684183597
66566592953805327
66566681624716656
66566681624716656
66566201287196994
66566188208210073
66566188208210073
66566188208210073
66566200811197470
66566791675606605
665667916756...

result:

ok 200000 lines

Test #39:

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

input:

199998 199999 39194 1342
0
532748
-882852
208383
23396
320272
447932
-167224
-561952
-513393
267799
-646333
248190
-328895
96572
404219
205510
-229944
-397956
-627878
637090
-506667
373251
99340
450310
818168
-80695
-41147
548160
247285
826165
-255286
496002
612057
390065
840815
-291188
899709
-1022...

output:

-2523021757459674
-2523056560518926
-2523057040974362
-2523043883808422
-2523034470091726
-2523024269924026
-2523060396364902
-2523060396364902
-2523060396364902
-2523087435411174
-2523087435411174
-2523087435411174
-2523092083750330
-2523087540223362
-2523104454389562
-2523104454389562
-25231119886...

result:

ok 199999 lines

Test #40:

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

input:

200000 200000 235627 132422
0
-626197
-595586
-577070
-988831
-777079
654943
265471
-914179
163723
-386963
580116
-384066
315416
690954
513258
875937
-641856
987709
955975
-205573
825991
-19394
-900650
822297
661725
502348
335386
-631762
-876586
-712397
681814
-244540
-996882
-440441
-261167
40682
3...

output:

-6904526355298879
-6904523031065829
-6904557303898254
-6904560197044019
-6904630171478889
-6904630171478889
-6904630171478889
-6904647136213584
-6904745751171209
-6904745751171209
-6904759230776259
-6904846752744459
-6904900573223114
-6904900573223114
-6904863505805699
-6904863505805699
-69049257749...

result:

ok 200000 lines

Test #41:

score: 0
Accepted
time: 93ms
memory: 6660kb

input:

199999 199999 122982 235253
0
736068
270529
842143
769464
571692
280436
594051
166447
543511
125139
-477512
-821132
55883
-347833
410112
-840973
484849
-288317
-611815
137778
-689281
201593
846833
-52056
28507
720413
275930
730876
-270464
-237666
424349
626852
610282
10206
-512596
-494549
-351919
84...

output:

7469303781190945
7469314534507325
7469364760623240
7469345770208132
7469421318823555
7469416311986039
7469440207521137
7469440207521137
7469528041952090
7469640257602487
7469728990201440
7469665941502344
7469665941502344
7469665941502344
7469608453249065
7469635120867424
7469632229103277
74696322291...

result:

ok 199999 lines

Test #42:

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

input:

199998 200000 93018 224222
0
506787
-367853
-545975
-270713
753683
295588
374459
-574349
-833318
-364829
-90291
965600
-870009
49754
-659417
587117
335201
403017
184305
301244
-630412
-317381
-705102
-631264
370301
174304
942793
-766276
996150
340705
420830
-136995
-22805
242358
629485
507491
-66312...

output:

8731209776691828
8731282579167348
8731276615945548
8731267762299628
8731359185115624
8731379333982700
8731377913436992
8731377913436992
8731377913436992
8731377913436992
8731377913436992
8731377913436992
8731395358058424
8731437506162588
8731532193990124
8731479909064920
8731578934234288
87316040803...

result:

ok 200000 lines

Test #43:

score: 0
Accepted
time: 104ms
memory: 6560kb

input:

200000 199999 1000000 1000000
0
-790817
262767
990520
244823
861016
976464
9608
-422107
311360
560609
781948
817453
372857
-582255
407823
967761
1635
-224858
-555149
619252
-455642
462995
303846
802212
741651
-414396
-640333
-101261
-937018
453691
-759597
-571240
252659
-976662
-100841
468963
-18535...

output:

-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-777587000000
-77758...

result:

ok 199999 lines

Test #44:

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

input:

199999 200000 2 10000
0
-247842
-695559
232112
-185081
-831783
-798102
398707
558002
-713772
-403365
19143
685614
626227
-648047
-496969
-209685
-152869
-42117
-927665
-494358
-965576
-906649
883835
523039
-548897
-745149
-864002
-497503
690079
632405
-625103
-533884
-392156
-881715
-274134
256074
2...

output:

665785818104278
665795580101488
665802009765298
665802009765298
665799716114120
665804022372696
665807951556702
665811558175234
665810478381236
665810478381236
665810478381236
665818962834006
665818962834006
665825643607584
665823462943804
665825035109308
665824002035964
665824227990764
665829136758...

result:

ok 200000 lines

Test #45:

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

input:

199998 199999 1000000 1000000
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000...

output:

-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
-1000000000000
...

result:

ok 199999 lines

Test #46:

score: 0
Accepted
time: 64ms
memory: 6500kb

input:

200000 200000 100000 1
0
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000000
-1000...

output:

-99998000000
-199997000000
-299996000000
-399995000000
-499994000000
-599993000000
-699992000000
-799991000000
-899990000000
-999989000000
-1099988000000
-1199987000000
-1299986000000
-1399985000000
-1499984000000
-1599983000000
-1699982000000
-1799981000000
-1899980000000
-1999979000000
-2099978000...

result:

ok 200000 lines

Test #47:

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

input:

199999 199999 999999 934523
0
-185281
160407
419600
-751655
-200874
-726500
473142
221669
-34085
-476723
-48314
-101737
-454356
90422
163219
-610965
-155728
-98495
-92711
21897
-128741
-867329
-764301
797450
298385
424890
-630951
99570
689685
-101959
-778245
-274313
-128987
-158899
928035
-379591
-7...

output:

-4367213567592269
-4367583721222115
-4368118392687443
-4368560180245655
-4367863464942371
-4367173513632323
-4366817955318934
-4366933368909434
-4366424780933328
-4366344575496853
-4366188888637668
-4366783265825174
-4367371107434729
-4367735552070284
-4368079005726830
-4368757529048306
-43680015938...

result:

ok 199999 lines

Test #48:

score: 0
Accepted
time: 74ms
memory: 6600kb

input:

199998 200000 985161 444
0
-814581
-630769
-969005
731208
-272163
300738
221146
-297368
-876685
525656
525630
369669
777267
752676
-577561
167765
-351087
-53603
-733431
-238022
-331720
-352831
865517
-265491
558824
-878800
-472714
-505632
-145081
-265871
-796389
-240072
-826488
326297
212935
-408715...

output:

-65704965925906332
-65704861287908478
-65705747584413762
-65704838025938787
-65705487519669345
-65705409563563323
-65704621200117840
-65704964197727997
-65704345752124449
-65704345752124449
-65704752687409416
-65704711874828634
-65705515301490066
-65705115736811844
-65704428414193014
-65704835273654...

result:

ok 200000 lines

Test #49:

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

input:

200000 199999 992452 945243
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100000...

output:

-992452047209
-992452094418
-992452141627
-992452188836
-992452236045
-992452283254
-992452330463
-992452377672
-992452424881
-992452472090
-992452519299
-992452566508
-992452613717
-992452660926
-992452708135
-992452755344
-992452802553
-992452849762
-992452896971
-992452944180
-992452991389
-99245...

result:

ok 199999 lines

Test #50:

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

input:

199999 200000 234534 190909
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100000...

output:

-278159000000
-321784000000
-365409000000
-409034000000
-452659000000
-496284000000
-539909000000
-583534000000
-627159000000
-670784000000
-714409000000
-758034000000
-801659000000
-845284000000
-888909000000
-932534000000
-976159000000
-1019784000000
-1063409000000
-1107034000000
-1150659000000
-1...

result:

ok 200000 lines

Test #51:

score: 0
Accepted
time: 74ms
memory: 6556kb

input:

199998 199999 222 999999
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1...

output:

-40406220
324683675316
726878273121
974768025231
1567906432092
2111953888044
2483902516095
2623363376634
3301216698780
3733378266618
4383986616009
4878609121386
5468464531530
5826404173590
6594957405036
7436196563796
8416632583359
8510613489378
9313403686587
10269766730223
10298342701647
10936868063...

result:

ok 199999 lines

Test #52:

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

input:

200000 200000 213456 909090
0
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
1000000
100000...

output:

-140508340590
345935298564
798950245848
833783422764
1345203105054
1754813968908
1871373706314
2311648116888
2799823189068
2963692299180
3527380528962
4079094115068
4323134348046
4731319857834
5307563585682
5616795854604
6287819019318
6873624932130
7053757965162
7263404661912
7365118874124
782622404...

result:

ok 200000 lines

Extra Test:

score: 0
Extra Test Passed