TWOVSTEN - Editorial

PROBLEM LINK: Problem

Author and editorialist: Denis Anishchenko
Tester: Hasan Jaddouh

DIFFICULTY: Simple

PREREQUISITES: Basic maths

EXPLANATION:

If X is divisible by 10 then the answer is 0. If X is divisible only by 5 then the answer is 1, because after the first multiplying X will be divisible by 10. Otherwise, the answer is -1, because we will never get 5 by multiplying on 2.

Author’s code