dangthanhmay's blog

By dangthanhmay, history, 9 months ago, In English

I have a math problem at school, but i haven't idea how to solve this problem

Given three natural numbers $$$n, a, b$$$. We define a pair $$$(x, y)$$$ as a beautiful pair if it satisfies all the following conditions:

  • $$$1 \leq x \leq a$$$
  • $$$1 \leq y \leq b$$$
  • $$$(x \times y)$$$ is divisible by $$$(x + y)$$$ and the division result does not exceed $$$n$$$.
  • $$$x$$$ and $$$y$$$ are natural numbers.

Requirement: Count the number of pairs $$$(x, y)$$$ that satisfy the conditions above and are considered beautiful pairs.

Input

  • Contains three natural numbers $$$n, a, b$$$ $$$(1 \leq n, a, b \leq 10^{10})$$$.
  • The data ensures that the result of the problem will not exceed $$$10^{18}$$$.

Output

  • Print the result after performing the required task.

time limit per test: 2 seconds

can you help me how to solve this problem

(I use a translator to write this post, sorry for my bad English)

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it