Kangho plays a game with stones. The stones sit in three groups holding A, B and C stones. Kangho wants all three groups to hold the same number of stones.
He moves stones one step at a time, and a step works like this.
- Pick two groups whose stone counts differ.
- Call the smaller count X and the larger count Y.
- Change the smaller group to X+X stones and the larger group to Y−X stones.
Write a program that prints 1 if repeating the step any number of times can make the three groups hold the same number of stones, and 0 otherwise.