#25

by asd

Submitted 3 years 6 months 1 day ago
Mon May 10 18:06:52 CST 2021
Judger: judger1
Dataset Version: v3

269 ms / 65404 KB
Final 100
Problem: lss1.trifang
Language: GNU C++ 11


#1

3ms / 8832KB / Accepted
Input
2 8 1
26500 19169 15724 11478 29358 26962 24464 5705 
28145 23281 16827 9961 491 2995 11942 4827 
Output
29358
Answer
29358
Checker Information
"29358"

#2

2ms / 8800KB / Accepted
Input
7 2 1
3902 153 
292 12382 
17421 18716 
19718 19895 
5447 21726 
14771 11538 
1869 19912 
Output
21726
Answer
21726
Checker Information
"21726"

#3

3ms / 8832KB / Accepted
Input
8 10 4
9894 28703 23811 31322 30333 17673 4664 15141 7711 28253 
6868 25547 27644 32662 32757 20037 12859 8723 9741 27529 
778 12316 3035 22190 1842 288 30106 9040 8942 19264 
22648 27446 23805 15890 6729 24370 15350 15006 31101 24393 
3548 19629 12623 24084 19954 18756 11840 4966 7376 13931 
26308 16944 32439 24626 11323 5537 21538 16118 2082 22929 
16541 4833 31115 4639 29658 22704 9930 13977 2306 31673 
22386 5021 28745 26924 19072 6270 5829 26777 15573 5097 
Output
336998
Answer
336998
Checker Information
"336998"

#4

3ms / 8876KB / Accepted
Input
3 7 1
9161 18636 22355 24767 23655 15574 4031 
12052 27350 1150 16941 21724 13966 3430 
31107 30191 18007 11337 15457 12287 27753 
Output
31107
Answer
31107
Checker Information
"31107"

#5

3ms / 8836KB / Accepted
Input
4 6 2
32209 9758 24221 18588 6422 24946 
27506 13030 16413 29168 900 32591 
18762 1655 17410 6359 27624 20537 
21548 6483 27595 4041 3602 24350 
Output
105102
Answer
105102
Checker Information
"105102"

#6

2ms / 8756KB / Accepted
Input
2 7 1
11020 4596 24021 27348 23199 19668 24484 
8281 4734 53 1999 26418 27938 6900 
Output
27938
Answer
27938
Checker Information
"27938"

#7

2ms / 8840KB / Accepted
Input
9 8 3
3728 14893 24648 22483 17807 2421 14310 6617 
22813 9514 14309 7616 18935 17451 20600 5249 
16519 31556 22798 30303 6224 11008 5844 32609 
14989 32702 3195 20485 3093 14343 30523 1587 
29314 9503 7448 25200 13458 6618 20580 19796 
14798 15281 19589 20798 28009 27157 20472 23622 
18538 12292 6038 24179 18190 29657 7958 6191 
19815 22888 19156 11511 16202 2634 24272 20055 
20328 22646 26362 4886 18875 28433 29869 20142 
Output
195246
Answer
195246
Checker Information
"195246"

#8

2ms / 8780KB / Accepted
Input
5 7 3
31998 10322 18651 10021 5699 3557 28476 
27892 24389 5075 10712 2600 2510 21003 
26869 17861 14688 13401 9789 15255 16423 
5002 10585 24182 10285 27088 31426 28617 
23757 9832 30932 4169 2154 25721 17189 
Output
173232
Answer
173232
Checker Information
"173232"

#9

3ms / 8800KB / Accepted
Input
7 10 1
28692 21425 10555 3434 16549 7441 9512 30145 18060 21718 
3753 16139 12423 16279 25996 16687 12529 22549 17437 19866 
12949 193 23195 3297 20416 28286 16105 24488 16282 12455 
25734 18114 11701 31316 20671 5786 12263 4313 24355 31185 
20053 912 10808 1832 20945 4313 27756 28321 19558 23646 
27982 481 4144 23196 20222 7129 2161 5535 20450 11173 
10466 12044 21659 26292 26439 17253 20024 26154 29510 4745 
Output
31316
Answer
31316
Checker Information
"31316"

#10

2ms / 8832KB / Accepted
Input
10 7 4
4474 28022 2168 14018 18787 9905 17958 
7391 10202 3625 26477 4414 9314 25824 
29334 25874 24372 20159 11833 28070 7487 
28297 7518 8177 17773 32270 1763 2668 
17192 13985 3102 8480 29213 7627 4802 
4099 30527 2625 1543 1924 11023 29972 
13061 14181 31003 27432 17505 27593 22725 
13031 8492 142 17222 31286 13064 7900 
19187 8360 22413 30974 14270 29170 235 
30833 19711 25760 18896 4667 7285 12550 
Output
278008
Answer
278008
Checker Information
"278008"

#11

3ms / 8828KB / Accepted
Input
1 5 1
21624 28019 2125 26576 21694 
Output
28019
Answer
28019
Checker Information
"28019"

#12

2ms / 8828KB / Accepted
Input
9 3 2
22466 4678 22593 
23851 25484 1018 
28464 21119 23152 
2800 18087 31060 
1926 9010 4757 
32170 20315 9576 
30227 12043 22758 
7164 5109 7882 
17086 29565 3487 
Output
93154
Answer
93154
Checker Information
"93154"

#13

3ms / 8780KB / Accepted
Input
8 5 2
25627 5629 31928 25423 28520 
6902 14962 123 24596 3737 
13261 10195 32525 1264 8260 
6202 8116 5030 20326 29011 
30771 6411 25547 21153 21520 
29790 14924 30188 21763 4940 
20851 18662 13829 30900 17713 
18958 17578 8365 13007 11477 
Output
104004
Answer
104004
Checker Information
"104004"

#14

2ms / 8840KB / Accepted
Input
1 9 1
2303 12760 19357 2324 6477 5108 21113 14887 19801 
Output
21113
Answer
21113
Checker Information
"21113"

#15

2ms / 8764KB / Accepted
Input
1 1 1
12993 
Output
12993
Answer
12993
Checker Information
"12993"

#16

2ms / 8904KB / Accepted
Input
5 6 1
31111 28704 12835 32356 6072 29350 
18823 14485 20556 23216 1626 9357 
8526 13357 29337 23271 23869 29361 
12896 13022 29617 10112 12717 18696 
11585 24041 24423 24129 24229 4565 
Output
32356
Answer
32356
Checker Information
"32356"

#17

3ms / 8764KB / Accepted
Input
10 3 1
29855 12053 16962 
3584 29734 6654 
16972 21457 14369 
22532 2963 2607 
2483 911 11635 
10067 22848 4675 
12938 2223 22142 
23754 6511 22741 
20175 21459 17825 
3221 17870 1626 
Output
29855
Answer
29855
Checker Information
"29855"

#18

2ms / 8760KB / Accepted
Input
5 6 2
23850 17398 22279 22701 12193 12734 
1637 26534 5556 1993 10176 25705 
6962 10548 15881 300 14413 16641 
19855 24855 13142 11462 27611 30877 
20424 32678 1752 18443 28296 12673 
Output
87936
Answer
87936
Checker Information
"87936"

#19

1ms / 8820KB / Accepted
Input
1 4 1
20072 12818 610 1017 
Output
20072
Answer
20072
Checker Information
"20072"

#20

1ms / 8724KB / Accepted
Input
3 3 2
13169 23831 20040 
26488 28685 19090 
19497 2589 25990 
Output
93805
Answer
93805
Checker Information
"93805"

#21

2ms / 8792KB / Accepted
Input
6 4 1
18651 26740 22044 11258 
335 8759 11192 7605 
25264 12181 28503 3829 
23775 20608 29292 5997 
17549 29556 25561 31627 
6467 29541 26129 31240 
Output
31627
Answer
31627
Checker Information
"31627"

#22

3ms / 8672KB / Accepted
Input
4 5 2
6077 20215 8683 8213 23992 
25824 5601 23392 15759 2670 
26428 28027 4084 10075 18786 
15498 24970 6287 23847 32604 
Output
85026
Answer
85026
Checker Information
"85026"

#23

3ms / 8808KB / Accepted
Input
4 2 2
5706 2363 
9010 22171 
27489 18240 
12164 25542 
Output
93442
Answer
93442
Checker Information
"93442"

#24

3ms / 8876KB / Accepted
Input
10 4 4
6704 31818 9232 750 
25205 4975 1539 303 
11422 21098 11247 13584 
13648 2971 17864 22913 
11075 21545 28712 17546 
18678 1769 15262 8519 
13985 28289 15944 2865 
18540 23245 25508 28318 
27870 9601 28323 21132 
24472 27152 25087 28570 
Output
310900
Answer
310900
Checker Information
"310900"

#25

2ms / 8836KB / Accepted
Input
4 2 2
14423 3527 
11600 26969 
14015 5565 
28 21543 
Output
68092
Answer
68092
Checker Information
"68092"

#26

2ms / 8788KB / Accepted
Input
8 9 4
12637 22409 26463 5049 4681 1588 11342 608 32060 
21221 1758 29954 20888 14146 690 7949 12843 21430 
25620 748 27067 4536 20783 18035 32226 15185 7038 
9853 25629 11224 15748 19923 3359 32257 24766 4944 
14955 23318 32726 25411 21025 20355 31001 22549 9496 
18584 9515 17964 23342 8075 17913 16142 31196 21948 
25072 20426 14606 26173 24429 32404 6705 20626 29812 
19375 30093 16565 16036 14736 29141 30814 5994 8256 
Output
332110
Answer
332110
Checker Information
"332110"

#27

2ms / 8804KB / Accepted
Input
3 7 1
20482 1355 21015 1131 18230 17841 14625 
2011 32637 4186 19690 1650 5662 21634 
10893 10353 21416 13452 14008 7262 22233 
Output
32637
Answer
32637
Checker Information
"32637"

#28

3ms / 8800KB / Accepted
Input
5 4 3
26303 14256 148 11124 
12317 4213 27109 24028 
29200 21080 21318 16858 
24050 24155 31361 15264 
11903 3676 29643 26909 
Output
195051
Answer
195051
Checker Information
"195051"

#29

3ms / 8724KB / Accepted
Input
3 2 2
24948 1282 
13653 30674 
2220 5402 
Output
51011
Answer
51011
Checker Information
"51011"

#30

3ms / 8836KB / Accepted
Input
4 2 2
3878 20259 
19008 22619 
23971 30003 
21945 9781 
Output
91889
Answer
91889
Checker Information
"91889"

#31

3ms / 8820KB / Accepted
Input
5 3 1
25313 6698 5589 
12722 5938 19037 
6410 31461 6234 
12508 9961 3959 
6493 1515 25269 
Output
31461
Answer
31461
Checker Information
"31461"

#32

3ms / 8804KB / Accepted
Input
8 10 3
14700 13971 26264 15117 16215 24555 7815 18330 3039 30212 
29288 28082 1954 16085 20710 24484 24774 8380 29815 25951 
6541 18115 1679 17110 25898 23073 788 23977 18132 29956 
28689 26113 10008 12941 15790 1723 21363 28 25184 24778 
7200 5071 1885 21974 1071 11333 22867 26153 14295 32168 
20825 9676 15629 28650 2598 3309 4693 4686 30080 10116 
12249 26667 1528 26679 7864 29421 8405 8826 6816 7516 
27726 28666 29087 27681 19964 1340 5686 6021 11662 14721 
Output
240173
Answer
240173
Checker Information
"240173"

#33

2ms / 8804KB / Accepted
Input
5 10 1
17902 29873 17124 23941 32745 31762 28423 27531 4806 12268 
9318 5602 31907 24307 23481 1012 21136 26630 24114 26809 
4084 23556 12290 21293 29996 29152 1054 25345 14708 248 
7491 13712 5131 30114 16439 7958 24722 29704 6995 1052 
25269 7479 18238 26423 27918 10866 17659 32498 28486 21196 
Output
32745
Answer
32745
Checker Information
"32745"

#34

2ms / 8904KB / Accepted
Input
3 4 1
12022 1146 18392 13037 
3925 10647 29458 6602 
30807 4098 27830 29292 
Output
30807
Answer
30807
Checker Information
"30807"

#35

2ms / 8876KB / Accepted
Input
1 9 1
18352 20448 13882 540 28315 4575 8762 9567 22336 
Output
28315
Answer
28315
Checker Information
"28315"

#36

2ms / 8764KB / Accepted
Input
8 9 2
25828 13851 26816 24230 4449 16925 658 229 24520 
10940 29560 15147 25162 1655 20675 792 22361 31754 
16398 23146 8714 26946 21188 19569 8638 27663 15075 
24515 11521 475 15615 20528 13234 12570 905 9464 
19557 28962 14161 30524 12549 17469 330 31923 28350 
14333 22925 10910 19737 16336 18337 1278 12393 7636 
30714 28164 31591 19949 19135 2505 13337 10004 16337 
2623 28664 9970 25608 30568 19281 7085 9152 18373 
Output
110467
Answer
110467
Checker Information
"110467"

#37

3ms / 8760KB / Accepted
Input
3 5 1
23826 28396 7572 6249 14640 
29174 18819 943 32611 1941 
20289 8419 5565 3805 7585 
Output
32611
Answer
32611
Checker Information
"32611"

#38

3ms / 8780KB / Accepted
Input
7 1 1
2609 
11064 
9166 
16893 
16074 
13509 
30300 
Output
30300
Answer
30300
Checker Information
"30300"

#39

2ms / 8832KB / Accepted
Input
6 4 2
13161 31172 17968 27358 
26031 26268 19426 28510 
10422 30774 8779 30910 
23552 4182 25391 15495 
5764 874 1364 14902 
28255 4460 474 6972 
Output
114245
Answer
114245
Checker Information
"114245"

#40

2ms / 8808KB / Accepted
Input
2 3 1
21577 9789 25605 
30195 27594 7950 
Output
30195
Answer
30195
Checker Information
"30195"

#41

2ms / 8832KB / Accepted
Input
4 5 2
1012 11672 23439 13428 5912 
9762 5967 24408 4415 1908 
17223 11759 26434 5204 29486 
4319 958 5945 26806 8166 
Output
80248
Answer
80248
Checker Information
"80248"

#42

2ms / 8824KB / Accepted
Input
1 8 1
21787 28532 30556 30974 3447 5021 18283 26222 
Output
30974
Answer
30974
Checker Information
"30974"

#43

2ms / 8764KB / Accepted
Input
2 7 1
26948 12723 17982 22018 14776 9220 31111 
32182 23856 19490 8925 4324 6486 19677 
Output
32182
Answer
32182
Checker Information
"32182"

#44

3ms / 8832KB / Accepted
Input
10 4 3
15677 22668 31068 21991 
32196 7783 16828 7727 
29426 15871 10697 17612 
18703 11027 11408 5545 
9508 7185 30238 24237 
26443 21313 22501 8850 
25128 2111 23650 28149 
11192 1454 15869 681 
27465 20267 17713 19793 
18634 25472 20972 22830 
Output
165164
Answer
165164
Checker Information
"165164"

#45

2ms / 8820KB / Accepted
Input
2 3 1
13877 25770 702 
14364 1381 16590 
Output
25770
Answer
25770
Checker Information
"25770"

#46

3ms / 8832KB / Accepted
Input
4 8 2
32179 16595 20169 2327 12042 31310 28182 11058 
7926 9487 1670 32528 5651 2258 7213 9860 
25783 21286 2742 8610 4472 7128 18434 5841 
20718 3503 14867 24865 10938 1881 9257 22750 
Output
68745
Answer
68745
Checker Information
"68745"

#47

4ms / 8840KB / Accepted
Input
5 9 1
2661 26063 32756 20807 20278 19489 19435 6365 32075 
7586 1386 7833 8360 13330 26048 8928 29492 12433 
23840 6766 1735 19810 11599 11837 21892 31982 7328 
29352 11369 31244 21794 6608 9252 11647 17432 9535 
7208 3264 3497 23243 27649 22015 26841 189 16100 
Output
32756
Answer
32756
Checker Information
"32756"

#48

2ms / 8780KB / Accepted
Input
3 9 2
19851 24474 28633 29891 27200 19854 9990 25697 4919 
17780 22578 12931 32544 3340 13487 899 22525 8483 
5538 7492 6193 28252 25011 1560 15834 1840 31497 
Output
103618
Answer
103618
Checker Information
"103618"

#49

2ms / 8800KB / Accepted
Input
6 10 2
18805 28791 13392 13210 13549 21578 26979 30971 9277 73 
20193 1620 21497 13826 31276 19790 6582 13578 11159 20418 
26489 159 3449 12924 9072 10380 27008 27967 10208 6477 
18503 15370 32607 14196 12074 13722 12611 19019 28761 11056 
12890 31163 16683 13716 19932 25452 2741 4954 6813 2862 
10396 15460 20615 10904 2599 20136 4680 9198 27032 14387 
Output
101068
Answer
101068
Checker Information
"101068"

#50

2ms / 8796KB / Accepted
Input
5 1 1
17006 
8670 
241 
18882 
25249 
Output
25249
Answer
25249
Checker Information
"25249"

#1

5ms / 8724KB / Accepted
Input
42 68 14
26500 19169 15724 11478 29358 26962 24464 5705 28145 23281 16827 9961 491 2995 11942 4827 5436 32391 14604 3902 153 292 12382 17421 18716 19718 19895 5447 21726 14771 11538 1869 19912 25667 26299 17035 9894 28703 23811 31322 30333 17673 4664 15141 7711 28253 6868 25547 27644 32662 32757 20037 12859 8723 9741 27529 778 12316 3035 22190 1842 288 30106 9040 8942 19264 22648 27446 
23805 15890 6729 24370 15350 15006 31101 24393 3548 19629 12623 24084 19954 18756 11840 4966 7376 13931 26308 16944 32439 24626 11323 5537 21538 16118 2082 22929 16541 4833 31115 4639 29658 22704 9930 13977 2306 31673 22386 5021 28745 26924 19072 6270 5829 26777 15573 5097 16512 23986 13290 9161 18636 22355 24767 23655 15574 4031 12052 27350 1150 16941 21724 13966 3430 31107 30191 18007 
11337 15457 12287 27753 10383 14945 8909 32209 9758 24221 18588 6422 24946 27506 13030 16413 29168 900 32591 18762 1655 17410 6359 27624 20537 21548 6483 27595 4041 3602 24350 10291 30836 9374 11020 4596 24021 27348 23199 19668 24484 8281 4<...>
Output
3489234
Answer
3489234
Checker Information
"3489234"

#2

7ms / 8876KB / Accepted
Input
93 65 26
18866 14693 30664 23775 13000 12212 21100 7551 25476 6379 10943 17877 3789 361 11385 8272 11434 15144 29561 25563 14504 12946 23888 20308 12157 1430 5123 6464 4074 4346 13837 1981 25318 26611 16292 17591 3832 27123 6461 16991 31461 27330 28498 17369 17291 8400 14179 24117 2317 19914 1595 1441 5936 21867 7028 31453 27909 13973 17981 11503 26569 6816 1883 25367 5385 
28402 5230 17157 28681 15567 8310 1866 3687 13171 3477 31245 32764 6238 27671 2047 26115 4592 27311 32657 1405 53 7171 20580 22740 22530 13675 24320 25790 13377 10998 16586 21604 4489 19631 29744 8388 26610 18718 26919 18259 5927 14609 28119 21479 22716 6300 21396 16853 11458 20830 24593 30806 29849 14854 24272 26160 12294 12054 26333 146 4229 10471 10428 10559 22241 
29421 22688 16366 12033 26685 2270 25329 32261 22860 2208 8982 22162 32506 6878 11979 1897 7887 6538 14469 30783 17540 22795 7266 18633 13509 24557 2317 26134 32053 18135 12258 2593 17843 21693 16466 22951 18140 11094 12937 5174 2512 6097 9551 2695 21817 23492 21292 20237 <...>
Output
11572908
Answer
11572908
Checker Information
"11572908"

#3

4ms / 8816KB / Accepted
Input
49 30 16
32633 21367 12637 27323 25445 29003 27994 8086 3734 1452 5275 2541 1925 27201 4855 15304 22378 1391 28433 13260 2725 22826 28125 690 4189 29707 3935 25847 15719 30883 
18614 9428 30313 12048 8026 22640 17727 21709 2466 20565 23965 7887 14473 18976 21750 8653 11953 15229 4509 5343 18600 18771 13611 8778 6763 16188 1568 15002 17960 6968 
7373 7666 12360 418 22385 4001 13485 11619 22946 26613 16696 12389 6894 30804 31119 6219 18627 30088 18461 19295 32652 23643 90 12747 7965 1124 30284 32525 15953 21792 
12110 12197 497 20805 4112 3856 23256 27730 11231 23034 28501 24171 6438 20656 13265 27236 28469 19924 30386 18972 20802 13652 25471 13580 10925 20380 16708 13599 137 25867 
28728 15812 31831 11684 27293 14658 5140 26887 19688 77 29559 12959 10530 28630 2676 26140 10638 4391 25860 10276 18060 2094 12328 26437 5053 15385 4139 26927 26728 28196 
11304 14368 26396 12975 4813 1183 10391 148 23646 20333 3559 19127 11773 28601 32207 22495 552 18835 4460 19652 23171 18595 29720 7273 16088 29467 31375 211<...>
Output
4440422
Answer
4440422
Checker Information
"4440422"

#4

6ms / 8800KB / Accepted
Input
97 35 14
32172 11048 23 22291 18166 30261 4981 941 16461 29443 12245 3696 14229 8373 23900 3650 6703 24828 14731 8941 24523 1942 22710 8388 6013 788 23479 8073 19220 737 3555 28814 11431 16000 7997 
16411 17008 16917 20202 26128 1245 25639 6629 10699 8933 18596 16884 32076 24729 5413 16603 29591 17403 14964 31695 30298 1042 30540 19245 32464 28222 30815 10860 21989 13770 14749 9297 8091 25024 3252 
20321 13740 19713 26835 28316 5489 27796 26548 2664 25858 20543 5081 5580 21407 4436 27670 29662 22863 9166 16463 29055 6598 15772 19331 1861 28300 18493 12041 30649 23644 4237 13082 7619 30667 10463 
28816 32610 32042 12619 18413 30880 8108 31306 18847 4806 21452 13696 29571 23500 6377 10456 26535 21011 1587 6102 84 14423 7883 22313 25932 26079 12582 16000 1616 26358 17843 27807 7909 415 24765 
4530 10072 29317 7058 13281 22272 30257 22757 8740 7107 29311 6257 2393 10971 21587 11743 24468 3802 30088 24298 6582 22252 7977 11457 24385 19293 31716 19628 12394 19291 3771 5107 12912 14332 509 
23292 5677 4227 252<...>
Output
3467374
Answer
3467374
Checker Information
"3467374"

#5

6ms / 8820KB / Accepted
Input
40 77 8
27037 21757 13570 12020 12751 23324 32199 23935 15580 25132 11061 23452 17560 1277 21486 28717 5101 17446 4668 14376 20617 30956 15201 20634 3284 28517 8488 25068 13861 27613 4544 28773 13109 8056 2506 5617 18132 20505 19633 2337 2778 14211 22330 5490 5985 23998 24668 26834 10801 29373 23633 23136 25212 27453 13805 3700 25804 25840 12847 7135 31545 5595 12822 5748 1503 19196 18101 8903 20367 14897 19338 30516 6853 11093 31500 28195 31450 
15532 12675 3467 19835 18049 21020 10165 26714 8717 573 31043 20259 22427 12054 26736 1458 30698 4473 18841 21123 9427 9195 19709 1386 3371 16123 31169 5764 24555 20434 23095 12653 31374 23820 15711 179 22203 19910 12718 19851 31524 9976 7439 18371 29614 13062 5672 2552 5330 18321 25310 11785 3651 7571 16411 1483 4305 28587 22222 19455 2957 21173 564 24961 17454 31902 19287 27330 20147 28022 15828 24951 10314 11975 31200 28307 31089 
7462 10125 8307 17243 28679 12106 20825 31893 29654 23465 21020 24809 10819 18534 11550 30851 17629 17060 5501 6738 11746 32377 2215<...>
Output
1312401
Answer
1312401
Checker Information
"1312401"

#6

6ms / 8820KB / Accepted
Input
81 90 6
15820 16055 29841 11107 14143 5735 30121 4834 13992 5049 13131 16499 25812 9687 25420 18595 8684 4823 16311 6240 5623 22065 15219 26379 10912 17271 27167 3790 21049 16704 8001 16176 16385 12390 2208 15846 30114 21361 18414 10732 18942 19026 20394 29909 19755 30293 1861 1632 11708 23121 31364 15947 835 19233 6181 18540 8724 1112 17349 30461 23627 30001 16129 5944 21520 22981 11740 29732 17177 29825 14944 31662 23409 31702 7049 14843 9592 4146 862 7933 32556 20016 14433 16964 8358 20748 24105 6423 18919 14681 
12622 21188 32213 3062 14981 20276 28289 32062 15628 25538 32427 31871 25673 25165 31880 5037 29870 5772 31171 28504 991 11682 25793 8924 31767 15347 18217 31960 28360 21813 19876 32737 31361 27338 31969 21367 18453 25677 14301 16695 25338 9835 31585 4691 28911 31732 29388 24896 3297 5425 18962 13230 18704 4473 24837 28861 7278 18175 17363 1902 16199 15598 3280 22871 15143 3000 4982 15772 12793 6058 3242 12314 8300 22981 65 229 8091 10953 14275 6133 27116 17554 2671 8476 10040 28071 10879 13371 <...>
Output
802000
Answer
802000
Checker Information
"802000"

#7

5ms / 8808KB / Accepted
Input
69 53 24
7588 21949 14021 3622 5452 8682 30728 6968 13500 17380 5251 13518 14376 29016 27710 30619 21250 13123 14927 28721 26153 4953 7339 21374 26206 14504 20028 8342 1783 14201 18228 4019 31959 6263 14240 29305 28061 23315 4160 27007 24348 30502 3478 4876 15116 8664 31037 5918 15102 22978 5500 13489 20630 
32335 26395 13373 24052 30312 20853 25473 21107 10832 14543 32383 32662 21708 7912 10696 14911 28552 28113 25081 7202 16054 25855 1158 31098 16376 23711 21942 24314 128 21289 10223 11271 7797 31032 2100 7460 31129 12185 5100 23214 22314 11170 23525 24521 32006 13765 30872 19866 2066 13925 13231 32439 475 
1255 27332 28379 31102 11533 3948 19167 9158 7807 26740 15589 18069 31403 30826 18647 29573 29903 11615 19728 21966 30804 15852 31576 5995 2398 22387 24086 8568 5025 423 15809 15327 7030 23375 31384 20531 1326 5191 11923 21468 26278 18631 11161 7541 5915 8679 10739 10610 28992 24419 15105 4614 31630 
11932 21547 15940 27356 29408 1563 3204 13103 25323 13353 31752 6867 8110 24599 6623 939 10319 24063 <...>
Output
9802670
Answer
9802670
Checker Information
"9802670"

#8

5ms / 8780KB / Accepted
Input
56 54 6
22452 29153 16667 6553 8011 31655 3435 22019 27459 25689 31941 24039 23298 25368 27094 24845 24515 25216 6614 16545 909 31699 23318 894 7265 11603 29144 24492 16312 20463 18276 32038 2605 4130 3928 21985 3958 28185 22336 22283 1688 2324 13414 10128 1627 14862 1004 14307 26108 16800 28951 32507 5667 3363 
13806 2204 1556 22293 18948 14551 26921 9917 29586 26836 28800 29458 28360 16591 19697 27866 8037 29537 3395 13327 134 15873 11423 31878 18107 21194 25924 26067 26720 3967 7037 2663 43 9676 29904 2555 15873 6350 28537 4914 23054 13270 3607 12409 15892 24170 27556 23602 22787 29069 19370 8211 20683 29249 
31412 17352 1646 21833 4867 20192 8281 12339 31107 25062 3828 31638 9982 10958 16248 19097 4494 30868 28929 7092 19032 12831 24548 9915 9079 13419 15170 19480 29239 23527 6365 2391 16772 15644 23339 5865 2210 20624 15785 4897 14878 5610 31602 24195 16132 29270 17424 3390 12882 20011 29330 4599 28845 13772 
15070 1480 20563 460 16713 12681 5457 19029 20581 15438 30198 10698 8474 9008 17287 4779 268<...>
Output
747267
Answer
747267
Checker Information
"747267"

#9

2ms / 8900KB / Accepted
Input
3 9 2
17913 1451 6916 30945 29695 14644 10200 15192 21502 
31815 10670 30696 28254 31293 4300 18122 32573 12361 
4331 19175 9143 30122 22681 7078 27749 21541 22492 
Output
120017
Answer
120017
Checker Information
"120017"

#10

4ms / 8832KB / Accepted
Input
59 12 8
23064 13791 535 9335 30514 9374 29167 30194 8182 20975 30057 17018 
18870 27110 9241 12264 32052 9042 9831 7826 19651 27978 31959 25465 
30120 6920 19597 29379 12486 507 21776 3691 30331 15895 29518 19767 
14789 4208 21984 3562 24233 3079 18064 10939 28629 1251 11544 263 
22404 30052 12077 8515 8098 19925 4540 15156 32048 25152 16244 6754 
10987 27270 6276 18122 22312 18606 28582 7635 10499 2430 22620 30595 
8376 21320 10873 11251 22353 14087 24292 3328 24962 6059 10649 10308 
22993 7088 29936 25925 22009 23797 8738 21483 19345 19148 13065 16184 
10217 29261 16679 22579 7989 8433 26090 3365 30445 5468 30766 24840 
20339 12921 17156 22333 12535 26828 6578 18301 24472 18948 27899 11794 
15051 31440 17824 19527 11265 30452 18470 11549 26756 23452 9690 25151 
2722 11248 7955 3384 17934 17384 31415 2276 15235 28002 5888 18212 
12202 19314 30592 14038 10558 4089 29795 17925 14958 12153 28405 21596 
31107 1831 12132 10721 27842 10562 20422 17888 28052 17316 22621 6692 
18148 21655 28954 1645 4<...>
Output
1252454
Answer
1252454
Checker Information
"1252454"

#1

12ms / 11168KB / Accepted
Input
42 468 14
26500 19169 15724 11478 29358 26962 24464 5705 28145 23281 16827 9961 491 2995 11942 4827 5436 32391 14604 3902 153 292 12382 17421 18716 19718 19895 5447 21726 14771 11538 1869 19912 25667 26299 17035 9894 28703 23811 31322 30333 17673 4664 15141 7711 28253 6868 25547 27644 32662 32757 20037 12859 8723 9741 27529 778 12316 3035 22190 1842 288 30106 9040 8942 19264 22648 27446 23805 15890 6729 24370 15350 15006 31101 24393 3548 19629 12623 24084 19954 18756 11840 4966 7376 13931 26308 16944 32439 24626 11323 5537 21538 16118 2082 22929 16541 4833 31115 4639 29658 22704 9930 13977 2306 31673 22386 5021 28745 26924 19072 6270 5829 26777 15573 5097 16512 23986 13290 9161 18636 22355 24767 23655 15574 4031 12052 27350 1150 16941 21724 13966 3430 31107 30191 18007 11337 15457 12287 27753 10383 14945 8909 32209 9758 24221 18588 6422 24946 27506 13030 16413 29168 900 32591 18762 1655 17410 6359 27624 20537 21548 6483 27595 4041 3602 24350 10291 30836 9374 11020 4596 24021 27348 23199 19668 24484 8281 4734<...>
Output
3628190
Answer
3628190
Checker Information
"3628190"

#2

124ms / 38220KB / Accepted
Input
396 779 34
18689 32264 15410 19108 25202 14285 28381 15349 30402 13648 27958 27012 19594 4058 25652 8696 14115 20334 30106 4760 14090 6562 31612 3259 31113 17070 9471 16255 31636 29891 20576 14782 21490 24990 17976 18494 26781 12892 14846 1064 4970 10640 13261 9660 31212 11155 18279 28482 7318 8475 15483 17476 24865 26639 3107 16634 7213 18074 22449 26118 24107 5247 15531 11362 1914 3756 10772 5526 26576 2321 6893 3118 27868 29362 23036 10347 9258 24571 13004 11577 5190 3924 13301 20833 12580 7158 26269 10496 28607 21245 7999 17208 15617 24254 19372 20517 23523 15450 25167 25362 28373 12180 22196 9453 12384 10463 14156 2809 7946 20923 22634 26051 8314 13122 12434 23639 24540 11006 18931 10163 27527 8702 27954 8828 21981 14889 26985 240 23923 26066 7536 17692 24691 7564 9819 17231 7998 10303 22339 19150 4693 10619 24138 18121 22393 27149 15065 27534 31249 3792 26924 17405 6861 12742 26385 13116 14985 4455 30188 16044 11380 19001 15871 13339 29553 20129 14056 59 3773 4345 31083 18770 31186 5090 24178 8756 2548<...>
Output
20373162
Answer
20373162
Checker Information
"20373162"

#3

86ms / 30256KB / Accepted
Input
310 681 61
2959 31511 24294 7351 26164 1245 27572 4648 25487 24577 7142 2807 29239 2322 24800 15814 3539 28262 2988 9034 18641 8964 17481 24659 7771 14528 2885 4358 8326 1448 31118 22893 22221 22687 12933 24371 24767 24904 15444 4264 12532 20262 12929 23819 29765 27649 1732 16905 31036 13707 17430 21121 11210 14915 2059 6794 31032 15770 9825 1207 12384 26452 10969 9370 12829 562 11589 2694 1536 3534 11235 1177 10053 10182 24553 28922 7685 4124 16481 1376 14509 19677 10039 12244 31150 12545 19601 29879 3446 19091 3166 28166 23712 31762 10802 20445 3687 17686 1873 5690 3937 32310 32522 16388 28778 3114 23878 15180 12765 20013 9056 26322 20235 19365 3895 19659 7653 25862 6274 31457 22268 3060 22628 7036 22956 18088 3905 13376 147 660 15567 11735 6728 31306 32368 2288 23114 12954 10175 25735 22071 21242 18792 14695 25407 23852 6718 28398 26583 2074 30343 11537 30130 16901 27034 3999 16365 7646 30125 7882 16778 12276 3560 12515 10271 7632 30398 6501 22223 25949 124 18741 5498 8013 20514 17448 16433 16567 10867 40<...>
Output
63173817
Answer
63173817
Checker Information
"63173817"

#4

105ms / 43812KB / Accepted
Input
725 442 311
11037 8735 2990 22511 14925 22528 8687 18110 19826 8996 18706 29929 8305 14565 26071 26051 21666 29514 28665 24750 18485 23258 9392 27020 31950 690 17018 7543 20851 27350 12827 18354 5032 23749 16610 17119 11224 30288 20527 31346 26871 22187 7730 8293 12134 8645 3061 27438 3863 19925 1181 28654 1265 28469 27117 27883 27510 30324 10763 6208 24227 5287 25223 18131 5911 14847 13465 32648 120 25249 11946 20148 3859 9649 28438 28117 6338 15024 25649 4992 13587 26889 19848 32666 26790 5606 25193 6091 8151 25672 16805 10288 15517 6999 3732 7248 15282 18167 24410 17490 13557 18075 24681 31341 15116 15966 20807 15519 24141 7760 16018 3746 22239 13325 7489 14364 6684 31381 11052 13078 24378 7255 14543 24239 22315 23439 16458 18961 7105 21714 28077 11173 6678 20455 31859 22659 31787 4825 3660 20525 21967 27466 24352 12412 6339 25098 31312 9690 5147 19689 21823 11186 743 13001 29457 12581 28179 13815 30130 30207 25996 30907 16410 13289 21668 12333 3536 26592 30136 22859 9133 20453 10512 17481 32227 28918 130<...>
Output
1587819050
Answer
1587819050
Checker Information
"1587819050"

#5

195ms / 54764KB / Accepted
Input
680 806 137
7047 15116 23629 17933 31088 16847 25544 25743 26201 27661 13162 9945 14117 12522 17490 17893 5111 24269 5853 15847 20551 25374 27490 29741 2358 16206 29472 29770 32286 20248 3444 2163 22382 17415 25936 12585 20405 31289 744 16409 29436 2658 9646 6720 26713 15635 31361 25938 31169 17213 545 9309 19998 22513 15335 1961 2465 12137 26803 29668 18522 22348 31269 1147 9990 27694 528 3403 20008 18518 13867 24441 13147 4037 23562 21918 1254 15732 12621 27432 29585 5596 9240 25341 20151 8891 28611 16737 9885 7190 29138 7449 26882 25210 19239 3024 11255 28296 8566 11707 6897 22961 5370 7289 14877 25661 15974 16701 29683 7314 18719 22062 9486 2995 32168 5902 6715 2823 20573 25882 13520 10076 18533 25138 10559 13611 21218 18234 3050 31261 22122 31168 8249 4047 6843 9439 7658 25554 22698 22883 24745 30967 1629 31021 13793 19913 13242 29146 15569 3162 2847 2719 3298 26435 19028 18807 5688 18406 18366 13185 28807 12790 22485 27811 3112 58 9944 31348 31084 24205 23231 11865 14896 9514 4465 31470 20913 31014 389<...>
Output
312875167
Answer
312875167
Checker Information
"312875167"

#6

72ms / 34224KB / Accepted
Input
519 445 244
15371 22805 3330 14028 29864 9626 16038 28038 14792 13712 7937 4352 8697 9313 32420 1816 13552 28411 27282 23891 27761 295 21575 24783 15471 11542 31481 29305 26229 16701 31261 27519 7236 12388 8493 9737 13758 32761 30889 32292 32258 28841 6236 24318 23513 5426 13024 12377 22865 19314 31332 14394 20135 19396 17069 17633 13418 17037 1115 13054 24798 10258 9582 9250 13471 19085 11016 31092 31366 15999 14452 26277 32464 10567 32616 12582 8573 6644 1415 28568 26615 25688 25386 23940 20980 12893 24416 5964 30109 16285 3380 21089 9968 29484 20014 26039 11875 19384 24092 13942 21194 20949 19473 23795 14970 1170 1199 5598 26543 29776 20898 21437 21547 32724 29293 1176 28704 26522 12905 24566 2128 11116 8202 20745 22387 26164 18789 20774 18137 7183 8687 18040 8784 11938 30088 15092 17224 27569 3256 32655 30517 27117 26168 4015 9525 10254 10676 18656 30451 8738 14287 19145 2251 20773 31592 4958 25903 18641 24603 11095 20297 26551 4619 30432 8417 19855 27359 32402 16258 3021 12299 17570 27864 17525 1617 313<...>
Output
979231885
Answer
979231885
Checker Information
"979231885"

#7

42ms / 22040KB / Accepted
Input
220 547 66
29645 1899 26258 19526 24096 14943 8238 12103 28637 5672 5645 32060 5510 7125 12627 30155 24314 28502 19323 31886 4411 12851 28225 26983 1396 30334 19135 13076 31035 24070 11222 10243 13331 14797 26575 10599 9781 15804 5442 7307 25744 7318 1847 1638 9742 8235 21644 1393 9753 4558 28311 7605 4190 1800 2827 2856 22992 26254 25888 3641 10992 14705 6638 26282 16204 7317 9242 28830 24134 26212 15029 6131 20759 21699 5985 5585 31252 22341 26550 11395 28975 18847 28132 21894 18880 12893 5273 5600 25990 22995 31269 27827 30952 19797 14044 4114 9345 8875 25275 27667 18396 4031 7759 6182 29052 10905 8915 13989 4128 25997 7577 29356 18757 7091 23211 4138 6379 16792 689 16952 7836 3635 28693 15274 15275 12315 24422 11748 26298 25335 32506 10736 22654 31029 8664 6093 30151 11775 6612 14345 6842 21354 31996 25490 11105 12529 23091 32201 3431 9763 8476 19672 28444 26008 16698 11333 32703 23593 17493 19912 31997 6240 26655 31834 14773 17966 31511 5519 510 4828 174 11557 107 3396 24744 3805 2190 22081 9670 4745 27<...>
Output
73636690
Answer
73636690
Checker Information
"73636690"

#8

246ms / 65404KB / Accepted
Input
926 831 443
19879 15020 4335 11556 22205 3510 555 31389 27140 17160 28165 2016 29453 11194 26052 21346 8069 923 10124 3596 23233 20085 5774 667 10139 6802 891 3143 19581 19582 22846 24738 1467 22543 490 12484 12838 2723 6129 26021 11742 19113 14232 31690 20327 28771 1191 16932 15103 7145 14437 53 47 11378 19395 18292 13729 15567 4568 29683 1841 18744 22157 8255 27206 25163 21914 4231 27747 4434 7601 22785 20473 20933 13304 17290 27520 17424 3005 14477 32453 32149 9830 12069 29318 6645 28582 26758 13884 29067 10743 31385 12344 6458 32580 28134 29681 3945 2533 29367 12957 14923 27089 29050 6654 7012 14863 31336 5503 23625 31342 22628 9599 6311 16758 19238 16621 2438 19102 11416 29973 30159 13504 1408 14265 3084 1225 21856 8036 2416 16565 4506 30203 21015 14011 8152 22933 24206 17604 20395 24460 8854 13346 6003 28117 20773 32127 6270 16012 8622 2323 11892 16851 31394 16155 3570 20957 9527 31878 13941 27974 28264 16369 15226 27558 22845 8917 10467 24677 17996 29439 1693 8145 13440 65 16256 6765 32537 29288 28534<...>
Output
3219031796
Answer
3219031796
Checker Information
"3219031796"

#9

114ms / 42040KB / Accepted
Input
592 488 75
2113 24437 2558 7210 2495 2148 23352 18340 8214 6219 23291 16690 13100 8459 14068 5592 6593 25843 5256 20605 501 11572 23922 9209 17163 25748 16302 31599 31852 19046 25750 25821 9711 20921 9036 2545 30039 208 12887 11039 15646 25810 7313 20720 10353 28099 32064 10141 30843 18099 18307 14556 9958 32309 7408 30714 4511 4883 30587 21546 5082 14656 10905 17693 12375 27406 32678 1490 12515 6817 29060 29104 24353 6052 19334 14290 14986 32058 12172 22690 20403 15416 18287 8617 5326 5521 9631 7077 28532 6418 6410 7900 18338 31823 30784 433 19457 24029 10197 5493 19306 18625 24583 25983 18345 3113 30113 27775 9601 15194 10784 13327 7665 27114 18195 4747 21686 30767 2248 31523 14353 1015 7204 5166 3530 20857 13267 1985 20853 16524 30882 17025 18420 8727 22824 5301 27709 457 31916 27040 6494 14346 23875 2317 5566 22577 19769 5931 25509 20215 27570 18075 31486 17707 19601 28872 20572 6824 22425 2167 19772 3461 8914 6815 7562 24971 19503 20858 30310 7148 5741 11740 14887 10033 19774 27332 7584 29557 13479 1617<...>
Output
95166566
Answer
95166566
Checker Information
"95166566"

#10

269ms / 65184KB / Accepted
Input
782 902 36
2066 26208 31091 15158 13869 12534 14399 19306 9990 25675 19938 14297 9450 16199 25652 3920 7814 25779 1644 5490 22781 5369 988 27297 2104 13611 27355 27426 16766 18247 12290 2427 31812 14266 21915 10272 5446 9250 10070 13903 2006 32600 24126 5177 20852 13998 16620 610 13216 15477 5114 8266 18412 7107 28347 15949 6741 31091 18473 1736 15827 9836 20511 17021 3887 10023 26825 15417 6677 21611 21592 1972 21610 31067 27386 12216 9183 4787 27913 3973 25031 4943 17794 23413 20774 20973 20666 7388 15114 1075 31564 9522 9502 27380 19798 15476 22140 5039 13797 3783 7875 21336 10925 7519 4969 24155 28670 13983 14163 8671 7411 14721 16547 16967 12269 10297 28882 25343 18239 19989 13054 7029 21035 31912 29829 15717 19982 9255 27602 20570 25559 19219 16759 26226 31165 10520 20348 11873 3378 26934 27383 26296 26898 22302 27613 5736 3105 31711 26392 11905 21428 28097 20186 31040 16046 22385 27952 31305 23726 31327 27866 9265 15751 12389 25690 1855 29937 12457 5963 23924 1662 7108 25076 6088 19919 4900 797 20663 <...>
Output
22896678
Answer
22896678
Checker Information
"22896678"

#11

10ms / 11260KB / Accepted
Input
42 468 14
0 15724 0 0 0 0 28145 16827 491 11942 5436 14604 0 292 0 18716 0 5447 0 11538 19912 26299 9894 23811 0 17673 0 7711 6868 27644 0 20037 8723 27529 0 0 22190 0 0 0 0 0 0 0 0 15890 24370 0 0 24393 0 12623 0 0 0 0 0 0 26308 0 24626 5537 0 0 0 16541 31115 29658 0 0 2306 22386 28745 0 0 0 26777 5097 0 0 0 18636 24767 15574 12052 0 0 21724 0 0 30191 11337 12287 10383 8909 9758 18588 0 0 0 0 29168 0 18762 17410 27624 21548 27595 3602 0 30836 0 0 0 27348 19668 0 4734 1999 0 0 0 0 467 0 24648 17807 14310 22813 0 7616 17451 0 16519 0 0 6224 0 0 14989 0 20485 14343 1587 0 7448 0 0 0 0 0 0 19589 0 27157 0 0 0 0 0 18190 7958 19815 0 0 16202 0 0 20328 0 0 0 28433 20142 0 0 31998 0 10021 3557 0 0 5075 0 0 0 26869 14688 9789 16423 0 24182 27088 0 23757 0 0 2154 17189 0 2368 0 10555 0 7441 0 18060 0 16139 16279 0 12529 17437 0 193 3297 0 0 24488 0 25734 0 31316 5786 4313 31185 912 0 0 4313 0 19558 0 0 4144 0 0 2161 20450 10466 0 26292 17253 0 0 0 20649 0 4474 0 0 0 9905 0 10202 26477 0 0 0 0 0 0 11833 0 28297 0 1777<...>
Output
2283849
Answer
2283849
Checker Information
"2283849"

#12

69ms / 31132KB / Accepted
Input
406 441 27
0 17464 0 0 9224 0 755 0 0 0 28746 0 0 0 31952 19923 19100 14712 10162 26295 0 11882 0 14464 10609 0 0 0 0 19956 0 0 0 0 10346 15420 0 25048 10071 16764 32663 8217 3934 18831 0 0 28706 20759 0 0 0 12489 20747 31545 19487 9765 30811 0 0 0 10516 3732 0 4450 0 0 23239 0 0 4002 0 0 13776 0 0 0 7290 0 0 30608 28473 16495 32302 11276 0 0 6123 14148 2869 9146 0 0 2630 0 29356 0 0 30060 2654 827 0 191 0 0 0 0 29105 25888 0 22676 13864 0 0 9494 26709 0 0 26139 31973 0 0 21228 26674 30572 0 31889 5370 3214 0 0 0 10776 12344 0 0 12899 18086 24189 12533 29887 14205 16479 24771 27316 0 0 2459 0 1415 31780 0 28738 0 27090 11901 0 0 0 10917 0 0 0 0 15544 0 0 14073 0 0 0 17591 4884 0 21485 22490 0 0 17791 28985 0 0 0 0 8071 0 0 14595 27518 4114 20445 0 3266 9183 32289 25379 0 0 0 0 0 0 0 0 215 0 0 0 0 0 0 23803 0 5190 0 0 5641 18546 0 0 0 0 0 21589 32399 11029 23676 0 32704 0 23129 0 0 0 12927 30175 0 0 1441 16814 0 0 5768 22990 0 1470 25614 21 0 6717 21345 0 0 12134 31277 31523 0 0 0 13468 0 23179 26185 0 0 0 21<...>
Output
7162015
Answer
7162015
Checker Information
"7162015"

#13

101ms / 36820KB / Accepted
Input
449 643 150
18456 0 0 0 0 13564 6151 11859 0 3806 3563 6188 0 23188 0 0 0 26475 0 21498 0 0 0 0 10292 10618 17062 29479 0 31013 5785 0 0 0 30541 10837 0 0 0 0 5550 15813 4712 0 0 8555 7805 0 0 0 20782 18161 25127 32204 0 25759 7307 0 9019 32335 0 12441 0 0 18488 2618 0 0 10878 0 0 0 16430 0 32248 27628 0 17805 5565 0 0 10014 30192 15195 239 0 14890 0 0 29884 0 0 0 0 0 0 0 8389 26009 0 25470 0 7177 0 6342 16507 24741 0 0 0 0 28101 0 0 6653 0 8860 24647 0 0 31873 26065 31399 0 29128 26613 0 13480 2172 23876 0 0 31666 31357 0 22169 0 21419 7702 0 0 0 0 19841 11416 0 17179 0 0 0 12026 4769 0 8187 20766 0 18571 0 20266 0 0 0 10565 0 0 0 0 0 0 0 0 4597 0 0 0 24638 0 31981 4439 0 0 0 29058 0 11366 23808 0 0 0 14676 10119 25368 31593 21257 6423 3827 0 0 1341 20582 8721 0 1699 8462 6865 9986 0 3754 0 0 7239 2465 0 0 50 27497 0 32639 0 0 0 25315 24469 23226 0 1217 0 22218 0 0 0 4599 0 0 0 0 12904 0 12010 12767 11210 11604 0 29655 0 8676 27714 26796 0 232 0 0 0 10101 2781 8064 11678 9916 18929 0 0 0 0 13379 21778 0 0 0<...>
Output
189512610
Answer
189512610
Checker Information
"189512610"

#14

122ms / 39944KB / Accepted
Input
409 866 97
0 8896 29704 0 18966 0 0 0 0 0 0 11277 7605 1039 0 0 0 0 32087 31070 0 0 14063 0 30348 0 0 0 0 0 0 16951 13405 18924 29864 3114 0 0 30022 0 0 27623 0 11311 29269 0 0 0 5841 1801 2016 28061 0 0 0 0 0 0 0 0 0 21699 16944 0 0 26058 0 14402 6001 4321 0 23176 19611 23254 31157 3846 0 9683 0 0 27406 4275 10848 0 0 0 6609 2819 11818 15500 15013 0 0 27238 0 10071 25020 0 7309 30945 12078 22701 0 20255 20473 12707 28398 8169 0 17302 0 8155 20486 31366 31331 18942 22132 13081 21974 0 0 0 5286 30335 7447 12455 0 0 21028 0 19899 2070 20432 25726 11128 18060 0 0 3504 16192 0 16261 7790 25403 17552 32263 5911 0 4793 0 16069 13035 0 20586 0 2789 0 4591 9508 9662 6525 27782 0 0 0 9946 5943 31120 14540 0 0 27693 0 0 32739 0 0 16110 0 11778 12542 32178 0 16351 22812 12303 11084 0 0 11993 0 12896 0 11342 26376 0 30059 0 32102 0 18864 9581 0 28271 0 0 0 27873 28320 21879 23416 23078 0 0 0 7389 0 4609 16799 0 0 12284 4632 0 28296 29144 0 888 10062 0 24691 5530 0 0 20483 30121 10935 30311 0 8072 26635 0 0 11022 0 0 346<...>
Output
79749042
Answer
79749042
Checker Information
"79749042"

#15

70ms / 27924KB / Accepted
Input
257 703 22
0 9758 0 0 32129 0 18392 0 26121 0 0 0 0 27001 0 0 2435 20766 22048 30858 17162 13540 97 2416 0 0 30365 20176 11226 0 31700 0 0 0 13819 10485 3252 0 4157 20282 13309 21037 0 0 0 5855 0 13255 0 0 0 18871 0 12591 0 23127 2299 29693 17579 1457 1467 3072 0 17349 0 0 0 0 17364 0 8332 15380 0 17811 30178 30467 0 0 0 0 0 0 20256 0 10916 0 26428 4347 0 19774 0 16903 0 0 0 9605 3071 0 0 26212 32335 16442 16894 31428 0 25494 0 0 13176 3073 1217 0 0 18459 0 0 0 11607 26121 11159 0 31865 0 0 18100 0 6368 12755 10493 10557 8760 31741 0 0 0 0 15713 0 22392 18685 20469 2267 0 10930 2406 0 14737 0 20802 0 2768 2983 26107 0 2047 0 24661 0 0 27229 0 0 27399 0 12374 16404 28693 29096 0 13325 0 0 5676 0 31692 0 30713 24827 5615 13351 9534 12166 0 0 13827 0 0 0 0 519 12814 0 418 10946 26217 0 11750 0 0 0 17808 377 0 5855 0 0 32228 0 0 20667 5567 8453 0 0 14848 26742 0 0 30244 0 0 3281 0 10944 0 5530 0 13900 0 0 0 32348 28606 0 30276 13832 2450 0 18290 12796 0 0 9055 29773 16256 0 0 0 0 0 22792 0 12841 16844 30195 8344<...>
Output
4807944
Answer
4807944
Checker Information
"4807944"

#16

75ms / 31212KB / Accepted
Input
293 849 133
6736 0 0 0 12976 21295 0 25102 477 22813 0 18820 0 0 0 0 24522 0 16649 29141 20274 0 1414 0 0 0 0 21009 5605 31907 0 0 5141 0 17589 0 10996 0 0 8522 3761 31376 0 0 19326 0 18955 0 9012 31118 31300 4388 0 6013 7886 0 0 23003 28686 0 13120 15119 0 7365 4468 10604 0 0 0 0 4878 9380 8728 25207 0 0 22875 18838 0 15041 27210 11356 0 6324 383 23456 25642 0 5354 0 11865 32718 0 14487 16099 23708 1571 7780 0 0 0 4004 9108 16518 0 0 0 30904 0 18323 26539 0 7075 26056 15723 23998 14711 18049 0 0 23300 0 20334 0 6248 0 0 0 0 12894 3416 3770 7983 0 0 4475 0 12954 0 2049 23509 0 12046 0 16536 0 27769 0 10422 0 1008 25412 29194 20721 17111 17521 0 0 5586 0 0 24904 28748 5677 0 23220 0 0 0 0 0 15811 25754 0 0 23389 0 0 11434 26271 0 0 12989 19596 0 0 6434 0 11689 4823 0 14219 0 12192 7915 0 0 0 23285 28193 28358 0 0 0 14672 0 17599 3377 0 0 10711 12243 27273 18714 4613 12628 0 0 0 9268 12301 0 0 6642 0 22173 0 0 18529 0 0 3754 0 0 27723 32046 0 0 30570 26688 0 0 10987 14663 2399 8762 8313 0 15026 22329 0 0 21746<...>
Output
148241677
Answer
148241677
Checker Information
"148241677"

#17

192ms / 56564KB / Accepted
Input
726 776 149
4628 1635 0 7409 20067 13741 31345 31851 3150 0 0 0 0 8822 0 0 27273 0 24953 0 28687 0 0 17009 30758 0 0 29049 0 0 0 10690 0 13381 0 0 24090 16862 25191 0 2082 0 25768 0 0 20520 22957 0 0 0 0 4288 21788 18881 32454 1877 0 0 11537 0 0 21770 0 0 0 0 0 23082 0 24910 20959 10998 14187 0 0 0 0 3956 0 0 25168 15930 0 7844 29651 961 816 26402 0 723 0 7686 0 31353 24193 3970 0 21438 24930 10402 7902 0 0 15787 31740 0 0 28044 0 1538 0 6130 0 0 0 6122 0 0 0 7856 0 0 83 0 0 7352 0 0 0 0 0 9777 0 28622 31904 0 26658 0 0 11992 0 23192 0 14730 18343 0 12666 13235 0 6552 0 0 17175 0 0 0 0 30881 0 28454 0 30739 26945 0 0 17114 0 7824 27988 0 0 15378 0 8854 27759 19915 0 0 0 1329 0 22821 0 4704 0 27236 32750 25433 0 9238 0 0 23854 10014 0 21376 0 15328 0 0 0 17095 0 0 0 0 19419 17677 1615 28308 7183 0 0 10260 0 16572 0 0 15565 0 5962 0 0 0 0 0 22625 27015 32285 0 8068 9158 0 26098 0 0 0 1086 0 22148 0 0 7093 0 0 0 30209 0 0 12191 11170 0 18088 5934 11476 15581 11329 23330 0 4882 5087 0 21243 24633 8734 0 14454 0 <...>
Output
186936922
Answer
186936922
Checker Information
"186936922"

#18

186ms / 58744KB / Accepted
Input
831 631 137
9512 7650 6264 0 17749 0 14738 0 0 19441 0 0 6378 0 0 0 0 10668 16521 0 27519 15469 0 20549 20968 29432 17416 6054 7517 0 12653 3887 4615 2940 0 0 1338 0 6783 0 15529 0 0 605 6055 10112 16675 0 2944 1059 6690 24830 327 0 22366 0 0 0 0 30236 18565 20048 0 2091 0 18680 28113 31880 32082 0 0 0 0 0 0 11469 0 8297 0 29760 7064 31722 14120 0 0 28931 0 11610 7315 0 10851 0 26047 0 0 0 0 0 0 4676 9359 0 25448 5822 0 30337 7889 0 30007 32365 0 8152 31728 28359 0 24790 32581 30862 0 26528 0 0 16305 28945 0 18402 13526 21966 26282 0 0 163 30546 4112 3184 10131 0 786 25132 29816 9507 14718 0 0 0 0 0 0 22749 21939 4821 0 25750 20610 0 18729 0 0 0 0 5565 27109 7667 0 0 0 4259 28767 0 0 32717 27334 21697 21622 0 26996 0 0 16301 16184 0 0 0 15113 30352 11289 1647 0 0 0 16883 27728 31231 0 0 5198 0 30901 0 0 15262 0 0 0 0 14931 16685 19693 8632 28894 16830 0 11870 0 31742 0 3953 0 676 8170 6637 17256 12245 0 8419 0 26145 29414 21662 0 7471 30797 915 0 0 4568 0 0 0 0 0 0 0 0 22732 24508 0 0 10995 0 28257 0 0 0 0 0<...>
Output
158244252
Answer
158244252
Checker Information
"158244252"

#19

112ms / 44088KB / Accepted
Input
718 366 52
0 26357 30763 0 0 0 31871 23356 16459 0 0 4698 0 15729 0 0 15130 0 0 0 0 25199 2601 15817 31092 26234 17466 0 15178 0 12058 0 31613 0 11616 134 24425 5316 27665 0 5775 0 3325 12450 24634 0 13243 9017 26079 0 0 27620 0 0 0 0 0 0 0 0 29368 10504 0 0 7167 0 4637 0 0 0 0 0 0 9810 0 5176 22999 0 0 0 14683 26681 2040 0 0 18048 12512 17703 0 0 0 12767 5983 0 0 0 14282 30637 15156 20578 0 0 16010 0 0 17917 11463 25709 12397 6555 860 16330 0 0 0 0 25582 0 27520 26600 7934 4082 30145 22456 0 15346 0 0 0 12858 16234 0 17580 31597 0 0 0 0 20161 0 11054 22437 19116 29203 0 17358 19113 0 14653 0 0 10726 0 0 11011 0 15251 12293 28193 0 3838 0 0 0 0 0 0 9259 0 13203 0 0 0 0 0 30628 17500 3293 0 0 13216 0 0 32414 0 0 0 22223 9308 0 0 30988 0 31147 25755 0 0 25449 0 0 0 5523 31470 9275 24085 0 7772 6374 0 11643 0 0 28536 4771 0 20214 0 5897 0 28759 0 1578 0 12641 13469 0 24911 10091 0 28551 25047 0 0 8574 0 15092 0 17594 9264 31519 9799 950 0 0 31967 0 28612 0 0 8430 0 0 13455 3312 32352 0 2666 29899 0 0 0 25815 0 <...>
Output
24478479
Answer
24478479
Checker Information
"24478479"

#20

218ms / 56244KB / Accepted
Input
679 968 316
12512 0 0 0 23536 0 0 16360 0 0 7920 0 20860 20718 13506 0 0 8072 29699 0 21898 0 18910 0 0 0 378 0 0 0 27937 7998 0 30558 0 0 0 0 15532 0 0 0 13995 0 1468 32022 23072 26588 0 10793 0 30340 0 0 21446 11807 0 29526 0 0 0 0 0 19322 4735 8573 13659 0 0 0 5540 18222 23976 15881 0 9786 11497 0 17692 5290 2784 0 0 3769 12533 26528 12075 0 0 0 0 24505 0 21160 0 0 0 0 0 19740 0 31179 3729 16319 1177 17140 0 30909 0 0 30998 25352 22385 21973 0 0 0 10776 0 0 0 0 17626 0 0 4451 0 0 0 0 22504 0 0 29510 11109 21505 15270 0 26302 26144 0 27088 0 0 372 6768 14539 0 0 0 25834 13122 0 0 7016 22560 0 0 29193 6202 10612 27344 13354 0 0 0 5810 0 0 14496 0 23949 5626 30072 0 224 15800 11982 9349 0 2367 0 18048 602 13671 30433 0 0 27166 1876 0 10549 2583 16285 0 0 0 0 2438 1025 0 0 0 22570 15097 8655 29637 23526 0 0 0 0 25858 0 25022 9936 13778 0 0 0 0 0 11658 23439 14358 31845 0 0 0 0 18603 0 12802 9495 32727 0 0 12020 0 0 0 0 13196 0 16382 5561 0 0 0 0 18984 0 0 0 27012 19700 0 17735 29787 29177 0 0 0 407 0 1919 0 0<...>
Output
824422692
Answer
824422692
Checker Information
"824422692"

#21

9ms / 11168KB / Accepted
Input
42 468 21
6334 26500 19169 15724 11478 29358 26962 24464 5705 28145 23281 16827 9961 491 2995 11942 4827 5436 32391 14604 3902 153 292 12382 17421 18716 19718 19895 5447 21726 14771 11538 1869 19912 25667 26299 17035 9894 28703 23811 31322 30333 17673 4664 15141 7711 28253 6868 25547 27644 32662 32757 20037 12859 8723 9741 27529 778 12316 3035 22190 1842 288 30106 9040 8942 19264 22648 27446 23805 15890 6729 24370 15350 15006 31101 24393 3548 19629 12623 24084 19954 18756 11840 4966 7376 13931 26308 16944 32439 24626 11323 5537 21538 16118 2082 22929 16541 4833 31115 4639 29658 22704 9930 13977 2306 31673 22386 5021 28745 26924 19072 6270 5829 26777 15573 5097 16512 23986 13290 9161 18636 22355 24767 23655 15574 4031 12052 27350 1150 16941 21724 13966 3430 31107 30191 18007 11337 15457 12287 27753 10383 14945 8909 32209 9758 24221 18588 6422 24946 27506 13030 16413 29168 900 32591 18762 1655 17410 6359 27624 20537 21548 6483 27595 4041 3602 24350 10291 30836 9374 11020 4596 24021 27348 23199 19668 24484 8281<...>
Output
7717157
Answer
7717157
Checker Information
"7717157"

#22

17ms / 14084KB / Accepted
Input
125 396 63
3778 16467 18689 32264 15410 19108 25202 14285 28381 15349 30402 13648 27958 27012 19594 4058 25652 8696 14115 20334 30106 4760 14090 6562 31612 3259 31113 17070 9471 16255 31636 29891 20576 14782 21490 24990 17976 18494 26781 12892 14846 1064 4970 10640 13261 9660 31212 11155 18279 28482 7318 8475 15483 17476 24865 26639 3107 16634 7213 18074 22449 26118 24107 5247 15531 11362 1914 3756 10772 5526 26576 2321 6893 3118 27868 29362 23036 10347 9258 24571 13004 11577 5190 3924 13301 20833 12580 7158 26269 10496 28607 21245 7999 17208 15617 24254 19372 20517 23523 15450 25167 25362 28373 12180 22196 9453 12384 10463 14156 2809 7946 20923 22634 26051 8314 13122 12434 23639 24540 11006 18931 10163 27527 8702 27954 8828 21981 14889 26985 240 23923 26066 7536 17692 24691 7564 9819 17231 7998 10303 22339 19150 4693 10619 24138 18121 22393 27149 15065 27534 31249 3792 26924 17405 6861 12742 26385 13116 14985 4455 30188 16044 11380 19001 15871 13339 29553 20129 14056 59 3773 4345 31083 18770 31186 5090 2417<...>
Output
66479064
Answer
66479064
Checker Information
"66479064"

#23

30ms / 17504KB / Accepted
Input
165 479 83
16377 13275 16969 23153 658 18321 21214 10953 23428 28170 7622 6236 3113 17225 28353 8316 15061 14687 117 8392 26112 20212 10418 25178 4775 5155 6650 25922 14831 29067 24129 51 14860 26018 28401 10365 20065 11341 3633 30267 21224 1198 17767 14542 22229 2365 11515 12170 17014 19995 24927 15022 5214 14755 18764 6298 31170 19265 4430 828 17955 17543 130 16844 3629 26749 2718 697 27104 17721 17203 4579 8685 15280 5679 16138 19555 14796 27046 2182 7306 23231 3282 24121 27151 24982 6232 4291 13154 16913 9164 16628 8029 11186 29816 25479 16934 19220 2393 11533 10582 13694 10347 31271 29531 12984 20775 2040 30235 22813 14409 4314 14553 12274 12502 8528 17757 19446 9822 14653 5199 6714 3198 3411 6373 19763 26538 31949 12222 8206 21289 3937 29965 25667 10337 3952 17913 3437 11093 5249 28996 12121 24684 4589 23339 8797 28532 15835 6286 16875 14310 25711 17745 31077 31340 31551 6658 4915 15264 2311 1212 32276 17431 13725 18763 31921 24990 5671 27792 29560 19907 2443 28455 18599 23960 14631 6984 2727 24243 454<...>
Output
114641083
Answer
114641083
Checker Information
"114641083"
/*
Though leaves are many, the root is one;
Through all the lying days of my youth
I swayed my leaves and flowers in the sun,
Now may I wither into the truth.
 
- William Butler Yeats
*/
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
#include <bitset>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;
 
#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
#define dbg if(false)
/**==Info==
*Program:1
*Problem:Rhombus
*Date:2019-12-30
*Algorithm:My rubbish prefix sum and violence
*Status:Unknown*/
 
bool debug=false;
 
ll n,m,k;
ll a[1005][1005];
ll tri[4][1005][1005];
 
ll colsum[1005][1005],rowsum[1005][1005];
 
int dsuid[1005][1005],dsuind[1005][1005];
ll dsusum[2005][2005];
int dsdid[1005][1005],dsdind[1005][1005];
ll dsdsum[2005][2005];
ll f[1005][1005];
 
int dsuic,dsdic;
 
const int L=0,R=1;
 
void runDsu(int x,int y){
	int cnt=0;
	
	while(true){
		dsuid[x][y]=dsuic;
		dsuind[x][y]=cnt;
		dsusum[dsuic][cnt]=(cnt==0?0:dsusum[dsuic][cnt-1])+a[x][y];
		cnt++;
		x--;y++;
		if(x<0 || y>=m){
			break;
		}
	}
	dsuic++;
}
 
void runDsd(int x,int y){
	int cnt=0;
	
	while(true){
		dsdid[x][y]=dsdic;
		dsdind[x][y]=cnt;
		dsdsum[dsdic][cnt]=(cnt==0?0:dsdsum[dsdic][cnt-1])+a[x][y];
		cnt++;
		x++;y++;
		if(x>=n || y>=m){
			break;
		}
	}
	dsdic++;
}
 
inline ll getCS(int col,int st,int ed){
	if(st>ed){
		swap(st,ed);
	}
	
	return colsum[col][ed]-(st==0?0:colsum[col][st-1]);
}
 
//inline int getDSUId(int x,int y){
//	return dsuid[x][y];
//}
//
//inline int getDSUInd(int x,int y){
//	return dsuind[x][y];
//}
//
//inline int getDSDId(int x,int y){
//	return dsdid[x][y];
//}
//
//inline int getDSDInd(int x,int y){
//	return dsdind[x][y];
//}
 
inline ll getDSU(int id,int st,int ed){
	if(st>ed){
		swap(st,ed);
	}
	
	return dsusum[id][ed]-(st==0?0:dsusum[id][st-1]);
}
 
inline ll getDSD(int id,int st,int ed){
	if(st>ed){
		swap(st,ed);
	}
	
	return dsdsum[id][ed]-(st==0?0:dsdsum[id][st-1]);
}
 
inline ll getDSU(int x1,int y1,int x2,int y2){
	dbg cout<<"DSU="<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<dsuid[x1][y1]<<" "<<dsuid[x2][y2]<<endl;
	
	assert(dsuid[x1][y1]==dsuid[x2][y2]);
	return getDSU(dsuid[x1][y1],dsuind[x1][y1],dsuind[x2][y2]);
}
inline ll getDSD(int x1,int y1,int x2,int y2){
	dbg cout<<"DSD="<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<dsdid[x1][y1]<<" "<<dsdid[x2][y2]<<endl;
	assert(dsdid[x1][y1]==dsdid[x2][y2]);
	return getDSD(dsdid[x1][y1],dsdind[x1][y1],dsdind[x2][y2]);
}
 
inline ll getRS(int rownum,int l,int r){
	if(l>r){
		swap(l,r);
	}
	
	return rowsum[rownum][r]-(l==0?0:rowsum[rownum][l-1]);
}
 
void proceedL(){
	
	for(int i=k-1;i<=n-k;i++){
		int up=k-1;
		for(int j=0;j<k;j++){
			tri[L][i][k-1]+=getCS(k-1-j,i-up,i+up);
			up--;
		}
	}
	
	
	for(int i=k-1;i<=n-k;i++){
		dbg cout<<"Doing line "<<i<<endl;
		for(int j=k;j<=m;j++){
			dbg cout<<"Solving for column "<<j<<endl;
			
			ll p1=tri[L][i][j-1];
			ll p2=getCS(j,i-k+1,i+k-1);
			ll p3=getDSU(i,j-k,i-k+1,j-1);
			ll p4=getDSD(i,j-k,i+k-1,j-1);
			ll p5=a[i][j-k];
			
			dbg cout<<i<<" "<<j<<" p="<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<" "<<p5<<endl;
			tri[L][i][j]=p1+p2-p3-p4+p5;
		}
		
	}
	
//	dbg{
		ll mx=0; 
		for(int i=k-1;i<=n-k;i++){
			for(int j=k-1;j<=m;j++){
				mx=max(mx,tri[L][i][j]);
			}
		}
		cout<<mx<<endl;
		exit(0);
//	}
}
 
void proceedR(){
	
	for(int i=k-1;i<=n-k;i++){
		int up=k-1;
		for(int j=0;j<k;j++){
			tri[R][i][k-1]+=getCS(k-1+j,i-up,i+up);
			up--;
		}
	}
	
	
	for(int i=k-1;i<=n-k;i++){
		dbg cout<<"Doing line "<<i<<endl;
		for(int j=k;j<=m-k;j++){
			dbg cout<<"Solving for column "<<j<<endl;
			
			ll p1=tri[R][i][j-1];
			ll p2=getCS(j-1,i-k+1,i+k-1);
			ll p3=getDSD(i,j+k-1,i-k+1,j);
			ll p4=getDSU(i,j+k-1,i+k-1,j);
			ll p5=a[i][j+k-1];
			
			dbg cout<<i<<" "<<j<<" p="<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<" "<<p5<<endl;
			tri[R][i][j]=p1-p2+p3+p4-p5;
		}
		
	}
	
	dbg{
		for(int i=k-1;i<=n-k;i++){
			for(int j=k-1;j<=m;j++){
				cout<<tri[R][i][j]<<" ";
			}
			cout<<endl;
		}
	}
}
 
int main(int argc,char* argv[]){
	qi;
	cin>>n>>m>>k;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>a[i][j];
		}
	}
	
	//calc for the col sum
	for(int i=0;i<m;i++){
		colsum[i][0]=a[0][i];
		for(int j=1;j<n;j++){
			colsum[i][j]=colsum[i][j-1]+a[j][i];
		}
	}
	
	for(int i=0;i<n;i++){
		rowsum[i][0]=a[i][0];
		for(int j=1;j<m;j++){
			rowsum[i][j]=rowsum[i][j-1]+a[i][j];
		}
	}
	
	//calc for the dsu
	for(int i=0;i<n;i++){
		runDsu(i,0);
	}
	for(int i=1;i<m;i++){
		runDsu(n-1,i);
	}
	
	dbg{
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				printf("(%d,%d) in dsu %d ind= %d sum_until=%d\t",i,j,dsuid[i][j],dsuind[i][j],dsusum[dsuid[i][j]][dsuind[i][j]]);
			}
			printf("\n");
		}
	}
	
	//calc for dsd
	for(int i=n-1;i>=0;i--){
		runDsd(i,0);
	}
	for(int i=1;i<m;i++){
		runDsd(0,i);
	}
	
	dbg{
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				printf("(%d,%d) in dsd %d ind= %d sum_until=%d\t",i,j,dsdid[i][j],dsdind[i][j],dsdsum[dsdid[i][j]][dsdind[i][j]]);
			}
			printf("\n");
		}
	}
	
	proceedL();
	proceedR();
	
	//calc left up corner answer
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
//			cout<<i<<' '<<j<<" "<<a[i][j]<<" "<<max(0,k-abs(i-(k-1))-abs(j-(k-1)))<<endl;
			f[k-1][k-1]+=a[i][j]*max(0ll,k-abs(i-(k-1))-abs(j-(k-1)));
		}
	}
	
	dbg cout<<"ini="<<f[k-1][k-1]<<endl;
	
	//move to the right
	for(int i=k-1;i<=n-k;i++){
		for(int j=k;j<=m-k;j++){
			//move
			ll p1=f[i][j-1];
			ll p2=tri[R][i][j];
			ll p3=tri[L][i][j-1];
			
			dbg cout<<"F "<<i<<" "<<j<<"="<<p1<<"+"<<p2<<"-"<<p3<<endl;
			f[i][j]=p1+p2-p3;
		}
		
		//move down
		if(i==n-k){
			continue;
		}
		
		ll upt=0,downt=0;
		
		int up=k-1;
		for(int j=i;j>=i-k+1;j--){
			upt+=getRS(j,k-1-up,k-1+up);
			up--;
		}
		
		int down=k-1;
		for(int j=i+1;j<=i+k;j++){
			downt+=getRS(j,k-1-down,k-1+down);
			down--;
		}
		
		dbg cout<<"F:"<<i+1<<" "<<k-1<<"="<<f[i][k-1]<<" "<<upt<<" "<<downt<<endl;
		
		
		f[i+1][k-1]=f[i][k-1]-upt+downt;	
		
	}
	
	int x=k-1,y=k-1;
	for(int i=k-1;i<=n-k;i++){
		for(int j=k-1;j<=m-k;j++){
			if(f[i][j]>f[x][y]){
				x=i;
				y=j;
			}
		}
	}
	
	cout<<x+1<<" "<<y+1<<endl;
	return 0;
}
 
Main.cpp: In function ‘int main(int, char**)’:
Main.cpp:268:117: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long long int’ [-Wformat=]
     printf("(%d,%d) in dsu %d ind= %d sum_until=%d\t",i,j,dsuid[i][j],dsuind[i][j],dsusum[dsuid[i][j]][dsuind[i][j]]);
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Main.cpp:285:117: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long long int’ [-Wformat=]
     printf("(%d,%d) in dsd %d ind= %d sum_until=%d\t",i,j,dsdid[i][j],dsdind[i][j],dsdsum[dsdid[i][j]][dsdind[i][j]]);
                                                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^