2014 Pacific Northwest Region Programming Contest—Division 2 Problem U — limit 10 seconds Top 25

NoSuchKey