THC1 - Editorial

PROBLEM LINK:

Contest

Author: Chhekur

Tester: Pankaj Devesh

Editorialist: Pawan Kushwah

DIFFICULTY:

Cakewalk

PREREQUISITES:

Divisibility rules

PROBLEM:

You’re given a number, you have to find out whether it is multiple of 2,4 and 8.

EXPLANATION:

For a number to be multiple of 2,4 and 8, it should be divisible by 8.
For a number to be multiple of 8, the last three digits of that number must be divisible by 8.
If the number of digits in a particular number is less than three then the whole number must be divisible by 8.

Author’s solution can be found here.