A practice problem -- Mad Scientist (Mid-Central Regionals 2010)

Specifications
input
output
mad.cpp
mad.java