Question: You will be given two integers N and K , in addition to an array Arr of size N . You can calculate the function
You will be given two integers N and K in addition to an array Arr of size N
You can calculate the function FArr as follows:
Arr i Arr ik from i to nk
You are allowed to rearrange the elements of Arr any way you want.
Find the minimum possible value of FArr Since the answer can be very large return i modulo
Notes:
It is given that Arr follows basedindexing.
Input Format
The first line contains an integer, N denoting the number of elements in Arr.
The next line contains an integer, k denoting the value of k to use in calcuang FArr
Each line i of the N subsequent lines where i N contains an integer descring A
Constraints
N
KminN
ArriYou will be given two integers and in addition to an array Arr of size
You can calculate the function Arr
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
