// Topcoder SRM 578 DIV 2 L1 DeerInZooDivTwo
import java.util.*;
import java.math.*;
//rename the class name before submitting
public class DeerInZooDivTwo {
public static void main(String[] args) {
DeerInZooDivTwo obj = new DeerInZooDivTwo();
System.out.println(
obj.getminmax(
0, 0
));
}
public int[] getminmax(int N, int K) {
int min = 0;
int max = N;
int remain = 2 * N - K;
min = remain - N;
if (min < 0)
min = 0;
max = remain / 2;
return new int[] { min, max };
}
}
No comments:
Post a Comment