solutions for APAC 2015 Round D