The Problem

Time Limit: 5000 MS Memory Limit: 65536 K