You are given an array A of non-negative integers. You can pick any non-empty subset, S from the array A. The score of a subset S is the sum of the elements in S raised to the power of K, i.e. for a subset S={s1,s2,…,sm}, the score of S is (s1+s2+…,sm)K. Output the sum of scores over all possible non-empty subsets of A modulo 998244353.
Input
The first line consists of two integers N (1 ≤ N ≤ 1000) and K (1 ≤ K ≤ 300), Then N integers follow: a1,a2…,an (1 ≤ ai ≤ 109)
Examples
Input:
3 2
1 2 4
Output:
140
Note
There are 7 possible non empty subsets:
{1}, 12=1
{2}, 22=4
{4}, 42=16
{1,2}, 32=9
{1,4}, 52=25
{2,4}, 62=36
{1,2,4}, 72=49
The total of all of them is 140.
Test Case 1
Input:
200 33
586675996 834662638 582661564 801031252 368588510 481535057 299143636 154810868 748560222 444723881 594265644 271475209 483236369 825333010 838212251 941340273 181680951 475018532 725610690 980879808 290253341 255300094 222425864 305836905 309362719 673795903 526752784 272885696 498600892 541576513 293569958 586502788 546400101 932614930 922795145 738713347 627678736 854811027 599387102 172776156 368969197 453280296 317871960 878976720 860453033 510602497 926525753 419146537 830612914 980672268 468005306 166335891 911567226 922140110 434524807 424093053 590300567 371183659 721172742 600311592 210722614 317227418 793158971 401617057 449556863 501677314 892013630 839176022 524835881 940550248 839561467 764011513 989141930 192333644 484181005 785400847 674841029 209630134 964257438 941649848 836682055 640053044 493288668 662886952 142491554 659229917 884165257 346190427 135295371 636702497 710634145 170177475 893751212 553144583 498928648 173846992 274295496 676101828 165556726 499077801 920844845 446218268 371964528 518465222 701401156 687218925 309703289 579304688 823881043 802733954 252512484 579282959 844367812 695500833 748122407 825455122 386300070 502934300 179547526 934792800 783118124 441360402 356559179 327130654 998543269 475814368 713846691 788491645 617178564 384577123 166216557 684039923 651593797 821711021 704057885 243187642 943485338 885996539 369725079 504573341 230128629 304769483 940749404 725863600 460266942 378887332 700635348 115095533 583723838 352744521 560578526 984014856 678045467 988770077 470484548 380200831 349213692 849092703 695155761 125390576 970541165 842717904 202532794 848261409 892205344 324076314 401291603 958139378 960397596 669808951 333662236 895479878 866907097 938228867 851281251 333564143 552098658 371049021 356458887 441896629 907071903 336678292 857795316 302950189 898249304 663033041 993067004 494024812 140930107 733086617 107029928 909953444 616400129 799844902 322302802 644050662 253833551 636316553 633766994 300303396
Scoring
The goal for this challenge is the produce the fastest algorithm (i.e, the algorithm with the smallest asymptotic complexity), and as such you should include an short analysis of your algorithm alongside your code.