Bulb

1

1 votes
Easy, Simple-math
Problem

You are given current status of light bulb(ON/OFF) and number N.

The switch of the bulb is flipped X times. where X is total number of divisors of N.

determine if bulb is ON or OFF

INPUT FORMAT:

Input consist of two space separated integers A and N

if bulb is ON A is 1 otherwise 0

OUTPUT FORMAT:

If Bulb is glowing print ON otherwise print OFF.

CONSTRAINT

1 <= N <= 10^18

0 <= A <= 1

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

total divisors of 5 is 2 so switch will be flipped two times and finally the bulb will be OFF.

Editor Image

?