#B4184. Distinct Quotients
Distinct Quotients
Distinct Quotients
Jimmy has started learning division! Initially he learned about division with a remainder of \(0\) (i.e. exact division), and later he learned about division with nonzero remainders. Now he is well acquainted with the concepts of dividend, divisor, quotient, and remainder.
One day, he wondered: given a positive integer \(n\) as the dividend, and letting the divisor \(k\) be any positive integer, how many distinct quotients can be obtained when using integer division (i.e. the quotient obtained by computing \(\lfloor n/k \rfloor\))?
For example, when \(n = 5\), no matter what positive integer \(k\) is used, there are at most 4 distinct quotients: \(0, 1, 2, 5\). This is because:
- \(5 \div 6 = 0 \dots 5\)
- \(5 \div 5 = 1 \dots 0\)
- \(5 \div 4 = 1 \dots 1\)
- \(5 \div 3 = 1 \dots 2\)
- \(5 \div 2 = 2 \dots 1\)
- \(5 \div 1 = 5 \dots 0\)
Note that for any divisor \(k > n\), the quotient is \(0\). Being a genius, Jimmy finds this problem trivial and challenges you to solve it. Can you determine the number of distinct quotients for a given positive integer \(n\)?
inputFormat
The input consists of a single positive integer \(n\).
outputFormat
Output the number of distinct quotients obtained when dividing \(n\) by every possible positive integer \(k\). Remember that for all \(k > n\), the quotient is \(0\).
sample
5
4