Problem : https://atcoder.jp/contests/abc174/tasks/abc174_c

This is a question from Atcoder ABC 174.

Can someone explain why the answer doesn’t exist only for the numbers that are multiples of 5 and 2.(Why the answer will always exist for other numbers ?)

And why the answer will be less than equal to the “k” ?