You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int p = in.nextInt();
int beg = (p/2);
int end = 0;
if(n%2==1)
end = (n-p)/2;
else
end = (int) Math.ceil((n-p)/2.0);
System.out.println(Math.min(beg,end));
}
}
The text was updated successfully, but these errors were encountered:
import java.io.;
import java.util.;
import java.text.;
import java.math.;
import java.util.regex.*;
public class Solution {
}
The text was updated successfully, but these errors were encountered: