Chef and his array

0

0 votes
Easy
Problem

Chef has an array with N elements. He wants you to remove exactly K elements from the array such that number of pairs (i,j) where i < j and A[i] A[j] are maximum.

Can you help him with this?

INPUT

First line contains two space separated integers N and K.

Next line contains N space separated integers.
 

OUTPUT

Print the maximum number of such pairs.

CONSTRAINTS

1 N 20

1 K 10

1 A[i] 105

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?