Utility functions for Google Code Jam