This problem is used in private contest:zhima