1.4 Ayaan’s Droplet Machine
Ayaan is developing a quirky sorting machine in his lab. Initially, the machine holds a single container with n quantum droplets.
The machine has a peculiar operation it can perform on any existing container:
Select a container and reconfigure it into two new ones, such that one holds exactly twice the amount of the other.
All containers must contain a whole number of droplets (no partial droplets allowed).
Ayaan’s assistant, Manas, has a specific goal in mind:
He wants to know if it’s possible to arrive at a container with exactly m droplets using zero or more reconfiguration steps.
Your task is to answer Manas’s query for multiple experiments.
Constraints
Input Format
The input contains two integers n and m :
the initial quantity of droplets and the desired target droplet count in a container.
Output Format
For each experiment, print "SPLIT!" if the machine can produce a container with exactly m droplets.
Otherwise, print "STUCK!".
Example 1
Input:
6 4
Output:
SPLIT!
Explanation:
-
Example 2
Input:
4 2
Output:
STUCK!
Explanation:
-
Log In to solve the Question