• + 0 comments

    Simple Python Solution:

    def pageCount(n, p):
        return min( p, n-p +(n%2!=1) )//2