#K34192. Exact Dollar Spending Problem
Exact Dollar Spending Problem
Exact Dollar Spending Problem
Given an integer (M) dollars, determine whether it is possible to exactly spend (M) dollars by purchasing apples at ($3) each and oranges at ($8) each. In other words, you need to check if there exist non-negative integers (x) and (y) such that (3x + 8y = M). If such a combination exists, output Yes; otherwise, output No.
inputFormat
The input is provided via standard input and consists of a single integer (M) which represents the total dollars available to spend.
outputFormat
Print Yes if there exists a combination of apples and oranges such that buying apples for ($3) and oranges for ($8) sums exactly to (M). Otherwise, print No.## sample
14
Yes