Problems from KTH Challenge 2016, adapted from KTH CSC Popup 2002 Session 1