Solution to Alice and Bob problem using C