| Final round of the 11th Regional Olympiad for the Governor’s Prize 2026, grades 7-8, Vologda Region |
|---|
| Finished |
Given a natural number $$$S$$$, determine whether it is possible to represent $$$S$$$ as a sum of consecutive integers, where the number of terms is between $$$A$$$ and $$$B$$$ (inclusive).
Three integers — $$$S$$$, $$$A$$$, and $$$B$$$ are provided, each on a separate line ($$$1 \le S \le 2 \cdot 10^9$$$, $$$1 \le A \le B \le 10^6$$$).
If a solution exists, output two integers: the first term of the sequence and the total number of terms. If multiple solutions exist, output the one where the first term is as large as possible. If no solution exists, output «NO» (without quotation marks, both letters capitalized).
Subtask 1 (up to 30 points): $$$S \le 100$$$, $$$B \le 100$$$
Subtask 2 (up to 30 points): $$$S \le 10^4$$$, $$$B \le 10^5$$$
Subtask 3 (up to 40 points): no additional constraints.
925
4 2
546
-1 5
134
NO
| Name |
|---|


