spoj; solve "subarrays" from Classical