#B4043. Ruler Marks Distance
Ruler Marks Distance
Ruler Marks Distance
Given a ruler of length \(n\) centimeters with marks at \(0, 1, \ldots, n\), you are given another mark at \(a\) centimeters. Your task is to determine all marks on the ruler whose distance from the \(a\) centimeter mark is exactly \(b\) centimeters, i.e. find all \(x\) such that \(|x - a| = b\) and \(0 \le x \le n\).
Output all valid marks in increasing order, separated by a space. If no such mark exists, output No solution
.
inputFormat
The input consists of one line with three integers \(n\), \(a\), and \(b\) (in that order), where \(n\) is the length of the ruler, \(a\) is the given mark, and \(b\) is the required distance.
outputFormat
Output a single line containing all marks (in increasing order) which are exactly \(b\) centimeters away from mark \(a\). The marks should be separated by a single space. If there is no such mark, output No solution
.
sample
10 5 3
2 8