Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import functools
- counted = 0
- @functools.lru_cache(maxsize=None)
- def multiply(a: int, b: int):
- return a * b
- n, k = map(int, input().split())
- n += 1
- half_n = n // 2
- for a in range(half_n):
- for b in range(n):
- product = multiply(a, b)
- if product >= k:
- if product == k:
- counted += 1
- break
- for b in range(half_n, n):
- for a in range(n):
- product = multiply(a, b)
- if product >= k:
- if product == k:
- counted += 1
- break
- print(counted)
Advertisement
Add Comment
Please, Sign In to add comment