1114

Problem ID: 1114

Since the sample input on UVa Online Judge is wrong, the correct one has been uploaded on uDebug.