The problem says "Will it fit, with one centimeter to spare on all sides?" That 1cm on ALL sides - top bottom, left and right. That means you need 2cm leeway in each direction. So, answer 1 if wc-ws<=2 and hc-hs<=2, otherwise answer 0.