PLEASE HELP ME

Can someone please help me with this submission codeforces DIV 2 contest 665 problem D
Link to Submission:

When m>n-1, multiply the first k large numbers of array p where k=m-n+1. Then multiply this number with largest value of w. Now for rest n-2 values multiply normally.