Solution to alice and bob problem using C.