Code working in Netbeans but giving error here

The link for code is : https://ide.codingblocks.com/s/78751

Hi Rishabh

Your code doesn’t work for the case
4
4
Bob 96
Alice 86
Suzy 86
Eve 78
Its running infinitely.

It’s working in this case also without any issue on my computer. No infinite loop. There is no reason for there to be infinite loop. Please find error if possible.

This is what I am saying. It is giving error here. But it is working in Netbeans.

Hi Rishabh
I have solved the error of infinite input. But still there is Time limit exceeded error because the complexity of the question is high.
Try implementing a a different logic.

import java.util.*;

class Employee {

public String Name;
public int Salary;



void display() {
	System.out.println(Name + " " + Salary);
}

}

public class Main {

static Scanner s = new Scanner(System.in);

public static void main(String args[]) {
	// Your Code Here

	int x = s.nextInt();

	int N = s.nextInt();

	Employee[] Emp = new Employee[N];


	for (int i = 0; i < N; i++) {

		Emp[i] = new Employee();

// Emp[i].input();
String name = s.next();
int salary = s.nextInt();
Emp[i].Name = name;
Emp[i].Salary = salary;
}

	for (int i = 0; i < N - 1; i++)
		for (int j = 0; j < N - 1 - i; j++) {
			if (Emp[j].Salary < Emp[j + 1].Salary
					|| (Emp[j].Salary == Emp[j + 1].Salary && Emp[j].Name.compareTo(Emp[j + 1].Name) > 0)) {
				Employee temp;
				temp = Emp[j];
				Emp[j] = Emp[j + 1];
				Emp[j + 1] = temp;
			}
		}

	for (int i = 0; i < N; i++)
		if (Emp[i].Salary >= x)
			Emp[i].display();
}

}