For this Question: Tono loves to do shopping. Today, she went to the market where there are N different types of products. She wants to buy exactly K of them at the minimum cost. Although she is super smart, she wants to check your smartness as well. Can you tell her the minimum cost required to buy exactly K products if she has already decided to buy product J?

<b>Note:</b> Tono does not buy the same product twice, and Tono will definitely buy product J (J is the <b>index</b> of the item).The first line of the input contains three integers, N, K, and J, denoting the number of products in the market, the number of products Tono needs to buy, and the product that Tono will definitely buy.
The next line contains N singly spaced integers, the cost of the N products C[1], C[2], ..., C[N].

<b>Constraints:</b>
1 <= N <= 200000
1 <= K <= N
1 <= J <= N
1 <= C[i] <= 1000

Output a single integer, the minimum amount Tono needs to pay.Sample Input 1:
5 3 4
1 2 3 4 5

Sample Output 1:
7

Sample Input 2:
5 1 3
2 4 3 1 1

Sample Output 2:
3

<b>Explanation:</b> 
Tono needs to buy exactly 3 products, and she will definitely buy the 4th product. Thus, she will buy the 1st, 2nd, and the 4th product. The total cost she pays is 1+2+4=7. 
, I have written this Solution Code: import java.util.*;
import java.io.*;

class Main {
	public static void main(String[] args) throws IOException {
		int n = io.nextInt(), k = io.nextInt(), j = io.nextInt() - 1;
		int[] arr = new int[n];
		for(int i = 0; i < n; i++) {
			arr[i] = io.nextInt();
		}

		int cost = arr[j];
		arr[j] = Integer.MAX_VALUE;

		Arrays.sort(arr);
		for(int i = 0; i < k - 1; i++) {
			cost += arr[i];
		}

		io.println(cost);

		io.close();
	}

	static IO io = new IO();
	static class IO {
		private byte[] buf;
		private InputStream in;
		private PrintWriter pw;
		private int total, index;

		public IO() {
			buf = new byte[1024];
			in = System.in;
			pw = new PrintWriter(System.out);
		}

		public int next() throws IOException {
			if(total < 0)
				throw new InputMismatchException();
			if(index >= total) {
				index = 0;
				total = in.read(buf);
				if(total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public int nextInt() throws IOException {
			int n = next(), integer = 0;
			while(isWhiteSpace(n))
				n = next();
			int neg = 1;
			if(n == '-') {
				neg = -1;
				n = next();
			}
			while(!isWhiteSpace(n)) {
				if(n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = next();
				}
				else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for(int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public long nextLong() throws IOException {
			long integer = 0l;
			int n = next();
			while(isWhiteSpace(n))
				n = next();
			int neg = 1;
			if(n == '-') {
				neg = -1;
				n = next();
			}
			while(!isWhiteSpace(n)) {
				if(n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = next();
				}
				else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double nextDouble() throws IOException {
			double doub = 0;
			int n = next();
			while(isWhiteSpace(n))
				n = next();
			int neg = 1;
			if(n == '-') {
				neg = -1;
				n = next();
			}
			while(!isWhiteSpace(n) && n != '.') {
				if(n >= '0' && n <= '9') {
					doub *= 10;
					doub += n - '0';
					n = next();
				}
				else
					throw new InputMismatchException();
			}
			if(n == '.') {
				n = next();
				double temp = 1;
				while(!isWhiteSpace(n)) {
					if(n >= '0' && n <= '9') {
						temp /= 10;
						doub += (n - '0') * temp;
						n = next();
					}
					else
						throw new InputMismatchException();
				}
			}
			return doub * neg;
		}

		public String nextString() throws IOException {
			StringBuilder sb = new StringBuilder();
			int n = next();
			while(isWhiteSpace(n))
				n = next();
			while(!isWhiteSpace(n)) {
				sb.append((char)n);
				n = next();
			}
			return sb.toString();
		}

		public String nextLine() throws IOException {
			int n = next();
			while(isWhiteSpace(n))
				n = next();
			StringBuilder sb = new StringBuilder();
			while(!isEndOfLine(n)) {
				sb.append((char)n);
				n = next();
			}
			return sb.toString();
		}

		private boolean isWhiteSpace(int n) {
			return n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1;
		}

		private boolean isEndOfLine(int n) {
			return n == '\n' || n == '\r' || n == -1;
		}

		public void print(Object obj) {
			pw.print(obj);
		}

		public void println(Object... obj) {
			if(obj.length == 1)
				pw.println(obj[0]);
			else {
				for(Object o: obj)
					pw.print(o + " ");
				pw.println();
			}
		}

		public void flush() throws IOException {
			pw.flush();
		}

		public void close() throws IOException {
			pw.close();
		}
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?