Sherlock and Counting

  • + 0 comments

    What's wrong with this?

    def solve(n, k): if n <= 4*k: return n-1 else: a = math.sqrt(n) b = math.sqrt(n-4*k) c = a*(a-b)/2 return 2*int(c)