will someone build me a c program about sorting the numbers

Job ID: 34745201

Budget: ₹600 – ₹1,500 INR

description is:
• 0 < N < 1000
• 1 <= K < 999
• 0 <= ai < 10000
if i enter a inputs something like this

Input:
10
2 4 6 7 2 4 5 6 3 6
4
the output will be 14