#P4466. Counting Special Pairs
Counting Special Pairs
Counting Special Pairs
Given a positive integer \(n\), count the number of pairs \((a,b)\) that satisfy the following conditions:
- \(1 \le a < b \le n\).
- The sum \(a+b\) divides the product \(a\times b\), i.e. \(a+b \mid a\times b\).
In other words, count the number of pairs \((a,b)\) such that
[ \frac{a\times b}{a+b} \in \mathbb{Z}. ]
inputFormat
The input consists of a single integer (n) ((n \ge 1)).
outputFormat
Output a single integer, the number of pairs ((a, b)) satisfying the conditions.
sample
2
0