QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#68126#4880. Network TransferA_zjzjAC ✓378ms12216kbC++14941b2022-12-14 18:35:212022-12-14 18:35:22

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-14 18:35:22]
  • 评测
  • 测评结果:AC
  • 用时:378ms
  • 内存:12216kb
  • [2022-12-14 18:35:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;using ll=long long;using pdi=pair<double,int>;const int N=2e5+10,p=1e2,P=p+10;
int n,m,w;struct zj{int t,s,p,id;}a[N];double now,sum,tot,ans[N];priority_queue<pdi,vector<pdi>,greater<pdi> >q[P];
void ins(int i){
	if(sum)tot+=(a[i].t-now)*w/sum;sum+=a[i].p;now=a[i].t;m++;q[a[i].p].push({tot*a[i].p+a[i].s,i});
}
int main(){
	scanf("%d%d",&n,&w);for(int i=1;i<=n;i++)scanf("%d%d%d",&a[i].t,&a[i].s,&a[i].p),a[i].id=i;
	sort(a+1,a+1+n,[](zj x,zj y){return x.t<y.t;});for(int i=1;m||i<=n;){
		double mn=1e9;int id=0;for(int j=1;j<=p;j++)if(!q[j].empty()){
			auto [s,x]=q[j].top();s-=tot*j;double t=s/j;if(t<mn)mn=t,id=j;
		}if(!id){ins(i++);continue;}
		auto [s,x]=q[id].top();s-=tot*id;double t=s/id*sum/w;
		if(i<=n&&now+t>a[i].t){ins(i++);continue;}
		tot+=w/sum*t;sum-=a[x].p;now+=t;ans[a[x].id]=now;q[id].pop();m--;
	}for(int i=1;i<=n;i++)printf("%.10lf\n",ans[i]);return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 5628kb

input:

2 10
0 100 2
4 200 1

output:

13.0000000000
30.0000000000

result:

ok 2 numbers

Test #2:

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

input:

2 10
30 200 1
10 100 2

output:

50.0000000000
20.0000000000

result:

ok 2 numbers

Test #3:

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

input:

1 10000000
0 1 42

output:

0.0000001000

result:

ok found '0.0000001', expected '0.0000001', error '0.0000000'

Test #4:

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

input:

1 10000000
42 1 42

output:

42.0000001000

result:

ok found '42.0000001', expected '42.0000001', error '0.0000000'

Test #5:

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

input:

1 10000000
42 10000000 42

output:

43.0000000000

result:

ok found '43.0000000', expected '43.0000000', error '0.0000000'

Test #6:

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

input:

1 10000000
10000000 1 1

output:

10000000.0000001006

result:

ok found '10000000.0000001', expected '10000000.0000001', error '0.0000000'

Test #7:

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

input:

1 10000000
1 1 100

output:

1.0000001000

result:

ok found '1.0000001', expected '1.0000001', error '0.0000000'

Test #8:

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

input:

1 1
10000000 10000000 100

output:

20000000.0000000000

result:

ok found '20000000.0000000', expected '20000000.0000000', error '0.0000000'

Test #9:

score: 0
Accepted
time: 194ms
memory: 11068kb

input:

200000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10000000 1
10000000 10...

output:

2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
2000010000000.0000000000
...

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 333ms
memory: 12092kb

input:

200000 1
10000000 10000000 22
10000000 10000000 62
10000000 10000000 71
10000000 10000000 73
10000000 10000000 82
10000000 10000000 15
10000000 10000000 60
10000000 10000000 26
10000000 10000000 35
10000000 10000000 83
10000000 10000000 58
10000000 10000000 84
10000000 10000000 23
10000000 10000000 ...

output:

1790041363636.3632812500
1390577580645.1608886719
1300784647887.3234863281
1280812465753.4243164062
1190840487804.8776855469
1859583333333.3330078125
1410498166666.6662597656
1750241923076.9228515625
1660420857142.8569335938
1180833975903.6140136719
1430416379310.3444824219
1170834642857.1425781250
...

result:

ok 200000 numbers

Test #11:

score: 0
Accepted
time: 346ms
memory: 12012kb

input:

199293 5
9504657 9159218 4
9229606 9939393 93
9949326 9400061 74
9049202 9678955 63
9856746 9805686 100
9900514 9492706 58
9077984 9828311 42
9082259 9783365 78
9815702 9654015 95
9655893 9753916 11
9027905 9930425 9
9210664 9496857 85
9488366 9132506 56
9416678 9238290 2
9475297 9343399 28
9442121 ...

output:

372606864555.1178588867
212211534775.6527709961
238948149663.0368347168
263425611185.3525695801
197063144013.4964599609
270580494646.0302124023
303467045798.2540893555
237141228118.9207763672
203504180187.0520629883
360171498662.9400024414
364170179095.5677490234
219530866865.6275024414
270186214835...

result:

ok 199293 numbers

Test #12:

score: 0
Accepted
time: 378ms
memory: 11948kb

input:

199775 5
9573917 9665464 57
9498813 9469832 81
9885957 9606395 14
9397765 9003071 9
9246019 9070405 26
9740136 9081183 11
9893308 9667485 60
9912483 9414387 94
9934996 9683245 7
9359993 9793294 90
9852046 9209808 22
9704268 9048813 52
9066664 9842295 49
9894656 9914370 56
9520915 9685732 36
9507809 ...

output:

275136188681.6192626953
227063705577.1867370605
355194309827.0283813477
363385338618.7606811523
329856159627.1572265625
359600267866.4042968750
269538859112.9399414062
201263971424.1476745605
368365549271.4277954102
215596647879.4338073730
338462086635.5036010742
277864582191.7748413086
291752383805...

result:

ok 199775 numbers

Test #13:

score: 0
Accepted
time: 367ms
memory: 12060kb

input:

199876 10
9569180 9097026 11
9805018 9888590 69
9859588 9812730 54
9708644 9290190 38
9672977 9335125 45
9617443 9706660 56
9670948 9431976 69
9705708 9008410 2
9091288 9600793 23
9064094 9794988 56
9750869 9563190 30
9234184 9600771 22
9681961 9478086 50
9410316 9590449 15
9604218 9991066 51
957349...

output:

179887507879.3583068848
127724903099.1162414551
141024141836.3531188965
153787858998.0389099121
147195733048.1214599609
138618997279.5928344727
124676275642.3486785889
188810825750.2686462402
169163511122.1374206543
139088289036.2459716797
162417585447.2086181641
170108072542.1214599609
143081618014...

result:

ok 199876 numbers

Test #14:

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

input:

199977 4
9602127 9565587 73
9111223 9419029 57
9833218 9019063 97
9020206 9577308 79
9062250 9637529 67
9457065 9295138 1
9448587 9234150 78
9535931 9639433 15
9247581 9592339 40
9768195 9797367 34
9649692 9879574 35
9727787 9190412 97
9260259 9150191 43
9851295 9229529 69
9724520 9333397 67
9676184...

output:

304491753262.7367553711
340031067721.0147094727
234313922207.0670776367
290561445183.4445190430
319806025765.5394897461
474840344781.4638061523
286089986044.7326660156
441518236521.8375854492
382411279202.5561523438
398221219099.1567993164
396587568673.4445190430
238678764660.4850769043
370475863738...

result:

ok 199977 numbers

Test #15:

score: 0
Accepted
time: 348ms
memory: 11832kb

input:

199077 6
9634388 9960151 22
9418114 9874787 41
9769850 9225397 37
9368769 9901425 8
9489208 9902249 82
9371370 9920615 49
9263226 9036325 88
9329155 9233456 23
9366876 9584570 56
9434611 9799061 9
9473832 9195956 44
9220704 9779369 72
9801558 9822981 43
9366955 9830926 27
9770139 9638731 78
9741872 ...

output:

283688147387.3331909180
254552170732.0891723633
256675980123.5558776855
304680729443.0338745117
192633843521.3573913574
242706661004.9937438965
170818527368.7014160156
279445737169.9197998047
229155389462.9852294922
303032608931.1423950195
245028698316.4506835938
206387719766.6679077148
251159922565...

result:

ok 199077 numbers

Test #16:

score: 0
Accepted
time: 285ms
memory: 8360kb

input:

199174 94
4939842 606 76
1166421 867 100
9051103 784 55
8172658 675 51
3743680 551 61
2613139 796 25
6619357 995 81
4244151 919 13
1565998 618 89
8971567 956 48
4453079 696 6
6507538 985 84
821657 762 98
5429287 786 27
6562208 661 86
286640 615 36
6512669 689 74
219589 615 49
8412173 719 58
8817089 ...

output:

4939848.4468085105
1166430.2234042552
9051111.3404255323
8172665.1808510637
3743685.8617021278
2613147.4680851065
6619367.5851063831
4244160.7765957443
1566004.5744680851
8971577.1702127662
4453091.6063829781
6507551.1499493411
821665.1063829787
5429295.3936170209
6562215.0319148935
286647.393617021...

result:

ok 199174 numbers

Test #17:

score: 0
Accepted
time: 271ms
memory: 8440kb

input:

199275 58
420812 937 34
5358924 565 84
341963 608 95
9557118 546 80
3131446 587 87
4631085 759 74
1944615 555 90
9739783 504 22
6129096 823 9
9113009 779 15
5896446 737 11
2838089 778 63
2887413 545 3
9842144 566 82
4824038 515 2
3489410 943 99
4094375 674 67
5967153 825 83
8442695 661 5
1099067 961...

output:

420828.1551724138
5358933.7413793104
341973.7034482759
9557130.9340394083
3131456.1206896552
4631098.0862068962
1944624.5689655172
9739791.6896551717
6129110.7375478931
9113022.4310344830
5896464.6034482755
2838116.8561892789
2887427.4137931033
9842153.7586206906
4824046.8793103453
3489426.258620689...

result:

ok 199275 numbers

Test #18:

score: 0
Accepted
time: 254ms
memory: 8252kb

input:

199757 100
8599274 773 87
2248916 983 76
6665957 948 34
8244088 933 17
4788589 623 6
4017807 722 19
4934229 616 11
202280 590 38
692193 527 18
9188184 884 97
2306679 771 19
9102374 572 34
2551259 547 96
6886224 621 32
3085867 871 17
6758447 763 57
1742348 667 52
4050359 520 18
808859 610 60
8347912 ...

output:

8599282.5271264371
2248929.2185526318
6665969.2199999997
8244097.3300000001
4788595.2300000004
4017814.2200000002
4934235.1600000001
202285.9000000000
692198.2700000000
9188192.8399999999
2306686.7100000000
9102379.7200000007
2551264.4993750001
6886230.5381250000
3085875.7100000000
6758458.782631578...

result:

ok 199757 numbers

Test #19:

score: 0
Accepted
time: 347ms
memory: 11556kb

input:

199301 55
9625480 9580 55
1972191 9544 50
2023060 7409 51
3155002 5100 49
5157066 8962 57
8573320 9043 52
5593516 7630 69
4095980 7228 37
9700572 7655 95
4873927 6900 49
8970656 7567 35
4513218 7294 83
90439 8204 19
2350487 9774 100
8833379 7311 70
8720440 6645 16
5196961 9762 63
7589832 6318 17
504...

output:

22664764.1775682345
19072434.5275919698
14847167.7312880903
13479463.3024860695
20842918.8926167078
22479839.0094935820
18374375.9549878798
21677924.3523034155
18966017.7911260426
19820640.7005909272
23346119.1813392155
14514855.7235762570
20704922.9341221489
9826141.1594906673
20068809.8719458207
2...

result:

ok 199301 numbers

Test #20:

score: 0
Accepted
time: 322ms
memory: 11384kb

input:

199784 70
5106450 7012 8
8862184 6409 38
3313920 6644 90
1841972 6860 90
9511699 8604 83
5624399 9771 93
3616263 6180 86
6894122 9030 49
4263669 9105 11
4949103 5598 32
5380890 6955 48
8146280 6286 53
7123063 6952 11
9394568 8476 55
4759565 6568 78
6956343 7496 74
7811801 9766 52
5673038 8211 55
507...

output:

20569989.7938139625
17924700.6613840275
6678833.9362816364
3781477.1436511409
16565452.1977062970
13829173.0919472463
7161775.5748993661
17739360.8462981433
20493408.0622409321
16664943.1772308089
15857800.2081597764
16526407.0936974902
20285025.5989932530
17776581.9574024938
10634690.7145910561
150...

result:

ok 199784 numbers

Test #21:

score: 0
Accepted
time: 310ms
memory: 10692kb

input:

199504 87
3284911 7920 70
8087820 7643 26
4604781 8931 34
5562076 8619 20
6201975 6720 98
9977988 8972 46
6605878 7152 95
2389753 7357 65
8826767 9661 24
5090545 8402 2
1791123 7868 49
9443698 5279 28
4155685 8121 8
3807424 7178 9
3021395 9299 93
225379 7716 41
5459773 5824 41
1420601 8155 89
744193...

output:

6416886.8626757758
15527062.0570008364
14488552.3893318996
15826799.6885926444
9289865.2335677780
15136631.6552415304
10288299.8330854774
4661712.4713136451
15976522.9439539611
17111357.5411659814
4630547.0590294357
15007084.3592209611
16615825.3177821096
16415542.4827278834
5457325.1437295740
68485...

result:

ok 199504 numbers

Test #22:

score: 0
Accepted
time: 346ms
memory: 12164kb

input:

199447 66
1042403 67371 93
1128688 78245 76
5016768 50046 51
8688565 60236 62
7728578 73421 61
4914558 84844 51
4044583 90549 45
4037722 73419 85
533462 83816 56
832748 81898 38
2603184 60202 97
7543832 99993 32
8706211 91645 79
5544589 91922 58
8719389 94288 83
9443633 51194 58
710110 98781 29
9077...

output:

97353589.2623791993
134963509.3103895783
139517888.2121612132
141786058.5238659382
157334920.1719169617
175394851.2724904418
184140886.5269134939
126378138.8616842330
163471348.7152259052
184991893.1174718440
90962705.0566128641
200054135.8040316403
155247504.7220351994
173087974.4432424605
15377910...

result:

ok 199447 numbers

Test #23:

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

input:

199929 82
9220865 86552 59
2985547 66016 60
1340761 51929 90
7375534 79510 99
4418854 68267 87
6932503 96935 100
7034197 65152 55
9533354 87179 1
5096560 88788 73
974191 95082 21
6677774 96696 10
1176893 73873 11
5738833 74842 80
9957447 62211 17
4645574 77470 94
7679536 61562 25
3324950 83656 14
98...

output:

137442730.6234973073
117719935.4230337739
60788949.5507037863
100808309.6236848086
95137085.2244299501
113655203.6736349314
125979076.4262129217
182717780.3048382103
126235560.6117836386
167628018.3987925351
176362017.8769285679
172963004.0194209516
110101567.3829196543
164701871.1942445636
99290091...

result:

ok 199929 numbers

Test #24:

score: 0
Accepted
time: 335ms
memory: 12028kb

input:

199029 73
4701835 79195 8
2211183 66584 48
2631622 53813 30
8759994 85987 36
8773487 81715 6
6319225 90424 41
23811 53497 64
2331496 50938 10
9659659 75158 89
6082500 89664 91
8121141 51790 18
2474312 52613 82
2771456 90383 69
7001526 77641 71
2907404 97855 14
948572 53328 84
3604146 68532 7
2907887...

output:

197343781.1339244246
146266455.2031445205
160277245.0260052979
172793852.1921652853
199572245.4455972612
169801859.0506979227
64949674.5064076111
189590139.1819819808
118032789.5737290978
127144382.9147313535
178153214.1220713258
83736576.6021947116
143463781.9044591784
135320085.1592963338
19392193...

result:

ok 199029 numbers

Test #25:

score: 0
Accepted
time: 336ms
memory: 12216kb

input:

199673 56
2610387 845669 2
1687829 988340 72
3821139 870884 35
2813428 799092 7
1365018 803557 95
9357496 513441 25
731413 980028 93
8363930 565303 23
4733785 973636 18
167256 773886 29
51133 651716 90
3480326 674090 12
4953792 831943 51
4343808 520658 51
2719391 642184 85
3121609 691825 39
7026995 ...

output:

2663416920.9790911674
1928512891.4654283524
2270470176.7050909996
2597243918.1633777618
1455194752.9088695049
2183638273.0667119026
1692789012.7853722572
2266073869.0224637985
2496007785.5626530647
2296006666.6833624840
1246768433.8333287239
2503127235.8526701927
2051884673.8863873482
1670260383.252...

result:

ok 199673 numbers

Test #26:

score: 0
Accepted
time: 319ms
memory: 11624kb

input:

199393 73
8091358 636821 63
3610955 902862 64
5111999 556237 78
6533532 853174 48
686517 962833 17
8744218 893633 70
3721028 529352 98
1162071 874456 32
9296883 502388 30
308699 714994 100
4191990 607788 3
4777744 786151 83
6953281 811671 52
8756665 654068 97
981220 909737 97
6324379 990946 6
730619...

output:

1275130082.9725670815
1493550552.9308993816
973568760.5789530277
1610876608.7341520786
1917650576.8220701218
1437555485.9825949669
745082252.3397953510
1766089887.5674312115
1584227879.3214328289
951064194.5873361826
2018503334.6606633663
1219497961.2094895840
1549263972.6803629398
930468945.0242513...

result:

ok 199393 numbers

Test #27:

score: 0
Accepted
time: 359ms
memory: 11900kb

input:

199875 63
6269819 886681 17
5467813 721870 48
6402860 741591 18
253634 907256 77
2409927 663402 32
762162 815118 11
1743775 756777 7
6657703 601020 44
3859980 976923 47
5417008 792908 74
602223 509641 4
8410806 856919 62
9019038 832694 49
833878 650671 51
9243051 594701 8
9593416 844285 65
9921030 9...

output:

2213856003.1257524490
1775683281.4445326328
2166436262.2599425316
1593306697.4423513412
1943159460.1901552677
2266283494.0425205231
2305962466.3870377541
1714438971.5108404160
1944956047.5884764194
1528248633.0534503460
2319079253.7725496292
1723020248.5554735661
1847280158.0889730453
1659435553.774...

result:

ok 199875 numbers

Test #28:

score: 0
Accepted
time: 355ms
memory: 12008kb

input:

199493 80
3646291 6589211 78
3835801 9820358 84
3775894 7887279 69
1403559 7547266 40
2451237 5385669 29
2904241 6950241 65
6125738 7100303 30
3526246 6344762 98
844701 9815023 18
5933784 5196196 40
8335782 9624783 43
5474890 5645503 81
4386861 6220368 39
1603653 7528687 13
6625714 6639631 16
706689...

output:

10214158002.1771450043
12572146296.1696281433
12430331164.9295291901
14939287831.8367233276
14878605249.4420299530
11989023568.2112617493
15721325037.9098281860
8103362035.4508533478
17454389308.5591850281
13196271301.7699661255
15545715392.3256969452
8679035263.7796802521
14234787112.3889770508
175...

result:

ok 199493 numbers

Test #29:

score: 0
Accepted
time: 321ms
memory: 11904kb

input:

199975 95
9127263 9824246 31
725793 7569723 72
5066755 8332179 9
5123663 8233302 69
4108380 6510726 43
2290963 9771814 6
4148486 9985610 39
3988744 5840025 14
5407800 5718449 27
6075227 5087718 10
9779149 9069107 56
9107953 7713115 56
1419484 6026900 32
6016510 8831954 72
4887544 9655430 27
269667 9...

output:

13937905496.8458080292
10033778296.3243808746
15207689460.1109848022
10738075363.2535114288
11827209682.2948894501
15492533171.5760593414
13480084569.6574306488
14400171178.1763763428
12982354715.3815345764
14665395594.5440082550
12092824838.9659366608
11426666478.2879676819
12620203552.0383110046
1...

result:

ok 199975 numbers

Test #30:

score: 0
Accepted
time: 331ms
memory: 11840kb

input:

199075 86
7305724 8126405 81
4918296 6090023 60
1390748 8810642 52
8843766 8148404 10
8463013 7635784 66
4308908 7593387 59
9473744 7133543 48
1820019 5301725 22
9970898 7292121 47
6216669 9208306 84
1222516 8546994 65
405370 9747164 27
8452108 5129623 33
8093724 5839029 26
813730 6967420 39
3538704...

output:

10721879434.6589546204
10797502325.4571876526
13464577925.9863700867
16627307131.1125545502
11616265493.2668514252
12203486352.2812862396
12909398946.9281425476
14651536819.8684692383
13101153739.1429672241
11291805629.2552890778
12310694615.6428546906
15583041967.5043144226
13108926037.7854976654
1...

result:

ok 199075 numbers

Test #31:

score: 0
Accepted
time: 321ms
memory: 9572kb

input:

199199 78151
308067 3510866 94
6357726 1383805 15
2657317 8797531 92
6497312 357768 66
1134727 3432114 28
7985088 8000696 13
147819 1655876 32
4881979 1216259 97
1470964 2232766 25
2929789 5183878 21
4171107 4419118 92
7436038 8910406 32
8680822 8565979 100
5307897 8959910 28
4773869 4268007 57
1347...

output:

335924.9688898816
7945776.9237731555
3336558.0558950743
6583286.3281338913
1513151.7593306773
12296920.3181997407
166073.3936243533
5030871.1733337771
1820619.9766720866
5288502.8097356530
4678750.7576076966
11701064.2082900219
10564865.5150359198
11024857.0191773418
5717138.8073775526
1556387.37836...

result:

ok 199199 numbers

Test #32:

score: 0
Accepted
time: 257ms
memory: 8336kb

input:

199681 594292
5789038 4364536 47
5583361 1412685 3
8981311 1101713 36
217414 8157858 7
5489360 880031 50
7371810 1431418 58
8170568 1612166 41
377610 8562820 5
1000928 2657627 33
8038099 2960000 100
8245697 1329846 4
3766590 9777839 7
5713444 6131898 5
7385110 6125691 82
3035698 5829090 65
4616843 3...

output:

5789045.3440934755
5583389.0587674081
8981312.8538243826
217440.3601815269
5489361.4808057323
7371812.4086105824
8170570.7127506342
377624.4084389492
1000932.4719212104
8038106.8197249835
8245699.2376979664
3766606.4529204499
5713454.3179884637
7385125.8796773441
3035707.8084611604
4616848.238047963...

result:

ok 199681 numbers

Test #33:

score: 0
Accepted
time: 273ms
memory: 8276kb

input:

199782 951648
8934366 5026718 9
7440220 1184668 91
272171 3405895 75
6568741 990652 36
2179636 8327948 65
9389755 4862140 7
1160181 6727240 51
840108 5909381 21
597159 8049784 53
8179541 5446522 70
4655931 8305983 17
2366518 645273 81
7779201 3889305 97
6764834 8067280 41
1297528 2614366 76
7885880 ...

output:

8934371.2821190190
7440221.2448594440
272174.5789441054
6568742.0409857426
2179644.7510802313
9389760.1091790237
1160188.0690423350
840114.8984099163
597167.4587830794
8179546.7232527155
4655942.0727537917
2366518.6780584836
7779206.9765070705
6764842.4771680282
1297530.7471985440
7885881.6252353815...

result:

ok 199782 numbers

Test #34:

score: 0
Accepted
time: 370ms
memory: 11708kb

input:

199013 2
5648444 6390891 30
4583777 4765203 91
6002297 9967339 67
2920106 5046393 16
1078536 9551957 15
4208514 8778670 95
6524454 7530040 44
5903729 8501282 33
3694577 8408932 62
771162 6157066 4
9717159 3022531 97
8386385 467293 82
5854615 1902200 68
1266157 8997519 45
2513227 4669366 78
8418928 5...

output:

422330846578.9990234375
217302476200.0554809570
388908111736.4552612305
447421455718.8038940430
473670311290.7991333008
321064635269.4555664062
403413314451.7337646484
435703578221.7092895508
378175228790.5209350586
488886966001.8128051758
140471687707.9597473145
28129828435.5603828430
127607157606....

result:

ok 199013 numbers

Test #35:

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

input:

199114 46
6162548 7053073 83
6440636 9761378 79
7293157 2271521 6
4304566 2846483 49
2735679 1967170 41
6226459 2209392 48
1849712 7677818 53
6366227 815139 41
593319 8833793 82
912605 3676292 74
6127392 4965964 98
4716936 6302023 45
2887238 4626902 61
5679015 5971812 3
8439414 6230450 94
6654831 42...

output:

13270785737.0926914215
15888659942.5136108398
19830440328.5433845520
10219121022.5934219360
8794729532.6805095673
8508652523.2972078323
16746925846.2831687927
4058690357.1336655617
15023451061.3321762085
9036976049.4701404572
9193518426.7112541199
16576759694.1590862274
12350448518.2112693787
213715...

result:

ok 199114 numbers

Test #36:

score: 0
Accepted
time: 342ms
memory: 12000kb

input:

199596 87
9307876 2682550 45
5666271 9533362 67
3617151 4575704 58
8024669 5679277 86
7090312 4447791 60
5613182 5640114 89
4839326 2601404 63
4197502 3128996 49
123283 4291358 90
8718404 6419710 49
5235115 1942100 11
3316864 2136753 20
9919861 7417013 58
5058738 3137593 50
6701243 2758829 1
9923868...

output:

5524614624.6039752960
8842445165.1434345245
6717217887.1529512405
5954728955.3728561401
6451381042.3131074905
5777733893.7858247757
4118838152.1380476952
5808315903.4871263504
4612176056.1527585983
8610704084.9360332489
9364167101.8270950317
7944757485.1711082458
8539108645.9091310501
5735633416.110...

result:

ok 199596 numbers

Test #37:

score: 0
Accepted
time: 344ms
memory: 12152kb

input:

199697 39
4788847 3344732 94
2556263 4529537 55
4908011 1912590 98
6711639 8446664 20
3780588 1895708 82
2597993 9070836 41
7828941 7781885 80
4660000 475557 70
4686381 4907707 15
8859846 8906232 19
6678482 3885532 19
4614282 7971483 95
6952484 9950228 58
7135952 303374 4
4963073 4576809 17
495414 1...

output:

8080516207.3960847855
15379520637.7415256500
4704955625.2851524353
23724826976.6233024597
5498253763.4582643509
21858676687.8755569458
16920641339.3984050751
1714686622.7396481037
23125936060.8543243408
23927692271.5758018494
21539830987.9688072205
15560365236.1173496246
20731573992.0942764282
14592...

result:

ok 199697 numbers

Test #38:

score: 0
Accepted
time: 346ms
memory: 11704kb

input:

199798 83
2967307 8974210 56
9446256 4301520 43
6198872 9184068 37
431742 1022562 61
8135221 4567817 97
1984715 7468854 82
5851688 2896959 89
155631 2789414 78
4216345 365272 23
3968155 6425459 94
3088715 861669 20
8247345 4063108 70
9018241 2740338 47
1548808 7277667 63
889259 6137892 24
8731318 36...

output:

9585283617.9599475861
8084038822.5312290192
10472903001.0849037170
1903914662.7851774693
4825951818.8985204697
7687860874.4480447769
3528421731.6197338104
3801412971.6217517853
1828843662.4048681259
6405828305.0064849854
4479058921.6692810059
5688131849.5880603790
5708000433.4628973007
8615588401.13...

result:

ok 199798 numbers

Test #39:

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

input:

1360 49
9871429 9779574 40
9989546 534733 28
3556340 8555939 45
2305081 5937120 29
5096830 6921998 49
7191025 9278305 8
1298498 9627142 14
671882 3049863 76
7402068 6967792 30
4959332 8268659 69
4691507 7797825 22
2723063 1478222 99
2602570 2927804 66
9779683 6186660 50
706855 189678 58
8926331 5264...

output:

123331351.3078603297
34603328.3370538354
117294057.8534235209
118724756.2226948589
109278783.8581888676
137076595.2229137719
134482946.2391410172
34527002.9992889687
122234510.1506222934
103418304.9705783576
128510981.4898462147
17110978.0926792882
51474075.0451885909
106097823.6921302676
1057524.68...

result:

ok 1360 numbers

Test #40:

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

input:

1842 93
5352399 376348 90
6879538 306716 20
9880335 860121 93
6025185 3737210 70
9451463 9594107 79
9208970 7676323 49
9321246 9774920 23
6167514 5363720 84
1965166 2616845 42
67641 5979374 47
6134874 4773961 31
9053615 7312952 74
9635193 5717915 63
1856896 8128249 5
8968685 1750762 73
2129100 39552...

output:

7987080.2469710708
20278894.5875759497
18320294.0610109456
47350535.1992691606
73982532.3305224031
79242940.0796009600
91559848.2606005073
53356053.0901793167
45696221.8319253847
61057205.3520112261
78364243.7116484195
68764097.5244879723
66605259.4351263791
97835462.2094778717
29811318.4123714231
5...

result:

ok 1842 numbers

Test #41:

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

input:

1562 34
8497727 1038529 44
8736396 5111403 4
1171194 3164303 36
9745289 6570004 3
6141739 7042024 94
3562558 1107045 97
4646504 4698505 36
8965656 7934473 92
1495130 3041706 58
5175950 3498600 17
209463 6717394 43
7653543 3147682 53
1700949 3475322 59
1236619 326734 63
4894871 3311845 81
5398137 238...

output:

56900292.5008922964
223642699.0802615285
139709814.6444375217
225822068.4098260403
132960879.3991200924
25062361.1712133102
172965317.4832625687
146396021.5519312322
94295992.1866990626
193221471.4171587229
177992215.1805950105
114510915.2337955683
104870587.9177499563
4380449.1980416318
83564411.80...

result:

ok 1562 numbers

Test #42:

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

input:

1043 86
1709320 1892199 5
2995165 5074875 96
2462055 5468486 76
6096614 4370095 41
496371 4489941 16
613636 9505064 42
7636118 4846283 46
4461287 248330 13
6058228 3466567 75
5317392 6050530 96
1652830 8660826 52
8950961 4015116 24
8733572 1041240 56
3313833 7492515 10
3156701 9905633 96
8667174 107...

output:

55728508.1056343243
24155440.3416811489
30021799.4647321589
43517016.2623286620
53263756.3154178038
51213710.9157231450
43989691.5870276615
12049581.5876006447
26940157.5798229948
32066791.2778446041
48039943.1704896465
50652583.1258813813
18099262.9891914167
58206179.4820194766
40418449.7456188574
...

result:

ok 1043 numbers

Test #43:

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

input:

1525 30
7190292 2554381 59
9885158 4846858 84
8786049 7772668 16
9816718 2170185 74
7186648 1937858 39
7664716 7968490 83
5658866 4994061 55
4923786 2562187 21
621325 4148323 87
5458834 8793948 66
3096197 604258 57
2584023 9849845 91
733061 8798647 57
7726690 9434104 64
1418530 6690908 4
1869943 473...

output:

99509524.6594757289
124746768.2631167322
238953615.1932317317
75827976.7067996114
110266382.4227357358
167850000.8984659612
161967658.5058390498
184761418.1521519721
87603266.8933286071
190877016.8005089164
24126960.8829435222
174123039.5609461069
196206527.5412334502
197568772.6092929244
252320975....

result:

ok 1525 numbers

Test #44:

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

input:

316 59
9188975 3868239 10
1555155 115859 26
5453579 247042 72
2822282 4185205 49
82066 6588164 75
5670503 7171636 83
9577189 1881903 17
7935150 4796220 33
4738599 2350579 56
417510 597470 97
647601 4861443 40
5843081 6719640 5
1819841 6829760 9
2504145 9651623 92
1334814 7014371 46
2616434 1788240 7...

output:

25295770.4864111841
1657034.3803443690
5846332.3032834260
14063725.1949885432
1173590.5436546130
18383473.7289527953
21350187.7635466792
22220128.5042495057
11031724.8426899835
502932.6616072076
5221978.6258042436
26841423.8436709046
26317074.2741671950
15961440.5160444416
16912327.1804458983
429598...

result:

ok 316 numbers

Test #45:

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

input:

139 8
9703080 4465013 64
3412014 9887842 14
6744440 2551224 12
9173609 1985295 87
4436699 4036081 94
24091 5569654 27
4902447 6805489 30
733291 2142781 49
9301697 7999632 69
558952 3340888 72
4722191 6613388 45
4443010 2554370 75
3885598 4587166 14
6917003 6817404 50
9596645 3608158 61
5885471 52546...

output:

49808572.7821731791
83536742.1910106540
71141235.2526023090
26003670.6994446032
32580177.9785774462
64511504.3049059659
71851346.0028443933
18137195.0125861727
61360909.2880491987
18439854.1815792099
64805623.2968817949
27308308.8305800185
76425232.5823343247
64079292.0164071321
45590861.5917501971
...

result:

ok 139 numbers

Test #46:

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

input:

363 48
2848407 94490 13
2637649 9916722 2
732789 4855406 51
2893711 4561193 20
1126975 6708190 16
7075171 9191864 76
7892061 1920562 39
6228923 4456638 61
3864794 8424493 85
5667261 860114 46
6165558 8556820 54
773561 8389099 50
918220 7120381 3
6296726 9015889 5
5522831 5169242 69
4121374 8912580 9...

output:

3564198.0792404381
38384664.5426366255
12056978.2760400269
33035516.6754692681
35505049.3132507950
29686269.6114426479
20274188.2195297331
23331133.1863117218
25006369.1451058462
9896480.7116207723
31484838.9086641409
26966227.7546105310
38143885.8151537552
37952386.1987947300
22945751.3529247306
24...

result:

ok 363 numbers

Test #47:

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

input:

186 92
8329378 5980864 75
4494508 4656001 90
7056784 7159588 95
6613815 2361283 57
448474 4156107 31
1428759 2622586 21
881675 2068340 48
1724555 6770495 69
3394759 8849354 1
5808704 3346636 17
7608925 5532956 67
7037846 4480725 29
582066 9910492 4
8373940 957478 59
3784660 6730326 80
2357277 760319...

output:

8451520.4502460714
4748304.7730095200
7286051.4492948512
6806855.2986805914
562187.7288199958
2067663.7522712131
1089997.1600037788
2362423.3850456267
7695970.2088108948
6515934.5231960937
7688659.8815503400
7434423.2954124324
3670385.3982808408
8409160.3210518658
3858730.1638586959
3163201.49027392...

result:

ok 186 numbers

Test #48:

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

input:

156 37
1474705 1610342 28
1384500 9460688 78
8347644 9463771 35
5300785 161374 90
7138751 6636728 57
8479838 6053308 62
8904423 2216118 58
2187053 4117056 86
7957857 4498407 18
917012 6090054 95
6716648 2443685 79
5704041 5282751 100
2647822 2443706 1
7753663 8123259 18
2046490 3515601 92
5626314 12...

output:

2957012.9967739382
6972018.8871737663
19389936.7894574851
5447846.4885360189
16878683.4602865502
16710975.8636937160
13198424.8285543192
4556052.5440111747
19208531.8160556816
1680056.5034684418
9897221.7172583044
11204977.0716201868
21648556.0338804275
20124373.9851259813
3676386.9986371244
1133161...

result:

ok 156 numbers