@@ -0,0 +1,478 @@
+import java.util.*;%0A%0Apublic class Solution %7B%0A%0A    static int solve(int n, int p)%7B%0A        // Complete this function%0A       if(p%3C=n/2)%7B%0A                return p/2;%0A            %7D%0A            else%7B%0A                return (n/2-p/2);%0A            %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        int p = in.nextInt();%0A        int result = solve(n, p);%0A        System.out.println(result);%0A    %7D%0A%7D%0A

add DrawingBook.java