[Solution] Integers that sum to the same value CodeChef Solution
Problem
Alice has a positive integer . She is wondering how many ordered pairs of positive integers exist such that .
Help Alice figure out the answer.
Note that since the pairs are ordered, and are considered different.
Input Format
The first and only line of input contains a single integer .
Output Format
Print a single integer, the number of ordered pairs of positive integers such that .
👇👇👇👇👇
Explanation:
As both integers must be positive, the minimum sum must be . Therefore there are no pairs of positive integers adding up to .
Explanation:
is the only pair whose sum is . Every other pair has a sum of at least .
Explanation:
The two pairs are and .
No comments:
Post a Comment