Winning CB Scholarship problem

what is error in my code-------------
import java.util.;
public class Main {
public static boolean isValid(int mid,int M,int N,int X,int Y){
return mid
X <=M+(N-mid)*Y;
}
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int N = cin.nextInt(), M = cin.nextInt(), X = cin.nextInt(), Y = cin.nextInt();
int low = 0, high = N;
int mid = (low+high)/2,temp = 0;
while(low<=high){
if(isValid(mid,M,N,X,Y)){
low = mid+1;
}else{
high = mid - 1;
}
temp = mid;
mid = (low+high)/2;
}
System.out.print(temp);
}
}

store all the inputs in long due to the constraints given in the ques

import java.util.*;
public class Main {
//it should be mid*X-condition
public static boolean isValid(long mid,long M,long N,long X,long Y){
	if((mid*X<=Y*(N-mid)+M))
		return true;
    
	return false;
}
public static void main(String args[]) {
	Scanner cin = new Scanner(System.in);
	long N = cin.nextInt(), M = cin.nextInt(), X = cin.nextInt(), Y = cin.nextInt();
	long low = 0, high = N;
	long temp = 0;

	while(low<=high){
		long mid = (low+high)/2;
		if(isValid(mid,M,N,X,Y)){
			low = mid+1;
			temp=mid;
		}else{
			high = mid - 1;
		}
	}

	System.out.print(temp);
	}
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.